MCPcopy Create free account
hub / github.com/DeepNotesApp/DeepNotes / constructor

Method constructor

apps/client/src/code/pages/page/notes/note.ts:181–538  ·  view source on GitHub ↗
(args: {
    page: Page;
    id: string;
    index: number;
    collab?: INoteCollabComplete;
  })

Source from the content-addressed store, hash-verified

179 }
180
181 constructor(args: {
182 page: Page;
183 id: string;
184 index: number;
185 collab?: INoteCollabComplete;
186 }) {
187 super(args);
188
189 const react: Omit<INoteReact, keyof IElemReact> = {
190 // Region
191
192 _nextZIndex: 0,
193 nextZIndex: computed({
194 get: () =>
195 Math.max(this.react.collab.nextZIndex, this.react._nextZIndex),
196 set: (value) => {
197 value ||= 0;
198
199 this.react.collab.nextZIndex = value;
200 this.react._nextZIndex = value;
201 },
202 }),
203
204 notes: computed(() =>
205 this.react.collab?.container.enabled
206 ? this.page.notes.fromIds(this.react.collab?.noteIds ?? [], this.id)
207 : [],
208 ),
209 arrows: computed(() =>
210 this.react.collab?.container.enabled
211 ? this.page.arrows.fromIds(this.react.collab?.arrowIds ?? [])
212 : [],
213 ),
214 elems: computed(() =>
215 (this.react.notes as (PageNote | PageArrow)[]).concat(
216 this.react.arrows,
217 ),
218 ),
219
220 islandRoot: computed(() => getIslandRoot(this)),
221 islandRegions: computed(() => getIslandRegions(this)),
222
223 // Note
224
225 rootNote: computed(() => {
226 if (this.react.region.type === 'note') {
227 return this.react.region.react.rootNote;
228 } else {
229 return this;
230 }
231 }),
232
233 dragging: false,
234
235 head: {
236 editor: shallowRef(null),
237 visible: computed(() => this.react.collab.head.enabled),
238 heightCSS: makeSectionHeightCSS(this, 'head'),

Callers

nothing calls this directly

Calls 9

getIslandRootFunction · 0.90
getIslandRegionsFunction · 0.90
isNumericFunction · 0.90
colorNameToColorHexFunction · 0.90
makeSectionHeightCSSFunction · 0.85
subMethod · 0.80
mulMethod · 0.80
fromIdsMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected