(args: {
page: Page;
id: string;
index: number;
collab?: INoteCollabComplete;
})
| 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'), |
nothing calls this directly
no test coverage detected