@@ -140,9 +140,6 @@ const getSymbolDefinition = (scope: Container, { id, name, svg }: Props) => {
140
140
return definition ;
141
141
} ;
142
142
143
- // https://github.com/facebook/react/tree/master/packages/react-reconciler
144
- // https://github.com/facebook/react/blob/master/packages/react-art/src/ReactARTHostConfig.js
145
-
146
143
export const Renderer = Reconciler ( {
147
144
createInstance : ( type : Type , instanceProps : Props , scope : Container ) => {
148
145
const { children, ...other } = instanceProps ;
@@ -207,17 +204,6 @@ export const Renderer = Reconciler({
207
204
instance . props = other ;
208
205
instance . type = type ;
209
206
210
- /*
211
- console.log(
212
- "createInstance",
213
- scope.name,
214
- scope.project.name,
215
- instance.project?.name,
216
- instance.type,
217
- instance.id
218
- );
219
- */
220
-
221
207
return instance ;
222
208
} ,
223
209
@@ -254,147 +240,51 @@ export const Renderer = Reconciler({
254
240
supportsPersistence : false ,
255
241
256
242
appendInitialChild : ( parent : Instance , child : Instance ) => {
257
- console . log ( "appendInitialChild" ) ;
258
243
if ( parent instanceof paper . Group && child instanceof paper . Item ) {
259
244
child . addTo ( parent ) ;
260
245
}
261
246
if ( parent instanceof paper . View && child instanceof paper . Item ) {
262
247
child . addTo ( parent . _project ) ;
263
248
}
264
- /*
265
- console.log(
266
- "appendInitialChild",
267
- parent.project?._scope.name,
268
- parent.project?.name,
269
- child.project?._scope.name,
270
- child.project?.name,
271
- child.type,
272
- child.id
273
- );
274
- console.log({
275
- child: {
276
- item: child instanceof paper.Item,
277
- group: child instanceof paper.Group,
278
- layer: child instanceof paper.Layer,
279
- tool: child instanceof paper.Tool,
280
- raster: child instanceof paper.Raster,
281
- child,
282
- },
283
- parent: {
284
- item: parent instanceof paper.Item,
285
- group: parent instanceof paper.Group,
286
- layer: parent instanceof paper.Layer,
287
- tool: parent instanceof paper.Tool,
288
- view: parent instanceof paper.View,
289
- parent,
290
- },
291
- });
292
- */
293
249
} ,
294
250
295
251
finalizeInitialChildren : ( instance : Instance , type : Type , props : Props ) => {
296
- console . log ( "finalizeInitialChildren" ) ;
297
252
if ( instance instanceof paper . Tool ) {
298
253
applyProps ( instance , props ) ;
299
254
}
300
255
return false ;
301
- /*
302
- console.log(
303
- "finalizeInitialChildren",
304
- instance.project?._scope.name,
305
- instance.project?.name,
306
- instance.type,
307
- instance.id
308
- );
309
- /*
310
- switch (type) {
311
- case Item.View:
312
- case Item.Layer:
313
- case Item.Group:
314
- case Item.Tool:
315
- applyProps(instance, props);
316
- break;
317
- default:
318
- break;
319
- }
320
- return true;
321
- */
322
256
} ,
323
257
324
258
appendChild : ( parent : Instance , child : Instance ) => {
325
- console . log ( "appendChild" ) ;
326
259
if ( parent instanceof paper . Group && child instanceof paper . Item ) {
327
260
child . addTo ( parent ) ;
328
261
}
329
262
if ( parent instanceof paper . View && child instanceof paper . Item ) {
330
263
child . addTo ( parent . _project ) ;
331
264
}
332
- /*
333
- console.log(
334
- "appendChild",
335
- parent.project?._scope.name,
336
- parent.project?.name,
337
- child.project?._scope.name,
338
- child.project?.name,
339
- child.type,
340
- child.id
341
- );
342
- console.log({
343
- child: {
344
- item: child instanceof paper.Item,
345
- group: child instanceof paper.Group,
346
- layer: child instanceof paper.Layer,
347
- tool: child instanceof paper.Tool,
348
- raster: child instanceof paper.Raster,
349
- child,
350
- },
351
- parent: {
352
- item: parent instanceof paper.Item,
353
- group: parent instanceof paper.Group,
354
- layer: parent instanceof paper.Layer,
355
- tool: parent instanceof paper.Tool,
356
- view: parent instanceof paper.View,
357
- parent,
358
- },
359
- });
360
- */
361
265
} ,
362
266
363
267
appendChildToContainer : ( container : Container , child : Instance ) => {
364
- console . log ( "appendChildToContainer" ) ;
365
268
if ( ! ( child instanceof paper . View || child instanceof paper . Tool ) ) {
366
269
throw new Error ( "Container can only hold View and Tool nodes" ) ;
367
270
}
368
271
} ,
369
272
370
273
insertBefore : ( parent : Instance , child : Instance , before : Instance ) => {
371
- console . log ( "insertBefore" ) ;
372
274
if (
373
275
parent instanceof paper . Group &&
374
276
child instanceof paper . Item &&
375
277
before instanceof paper . Item
376
278
) {
377
279
child . insertAbove ( before ) ;
378
280
}
379
- /*
380
- console.log(
381
- "insertBefore",
382
- parent.project?._scope.name,
383
- parent.project?.name,
384
- child.project?._scope.name,
385
- child.project?.name,
386
- child.type,
387
- child.id
388
- );
389
- */
390
281
} ,
391
282
392
283
insertInContainerBefore : (
393
284
container : Container ,
394
285
child : Instance ,
395
286
before : Instance
396
287
) => {
397
- console . log ( "insertInContainerBefore" ) ;
398
288
if (
399
289
! ( child instanceof paper . View || child instanceof paper . Tool ) ||
400
290
! ( before instanceof paper . View || before instanceof paper . Tool )
@@ -404,14 +294,12 @@ export const Renderer = Reconciler({
404
294
} ,
405
295
406
296
removeChild : ( parent : Instance , child : Instance ) => {
407
- console . log ( "removeChild" ) ;
408
297
if ( typeof child . remove === "function" ) {
409
298
child . remove ( ) ;
410
299
}
411
300
} ,
412
301
413
302
removeChildFromContainer : ( container : Container , child : Instance ) => {
414
- console . log ( "removeChildFromContainer" ) ;
415
303
if ( typeof child . remove === "function" ) {
416
304
child . remove ( ) ;
417
305
}
0 commit comments