@uniformdev/canvas-vue 18.16.0 → 18.16.1-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -307,7 +307,10 @@ var Composition = UniformComposition;
307
307
 
308
308
  // src/components/UniformSlot.ts
309
309
  import {
310
+ CANVAS_LOCALE_TAG_PARAM,
311
+ CANVAS_PERSONALIZE_SLOT,
310
312
  CANVAS_PERSONALIZE_TYPE,
313
+ CANVAS_TEST_SLOT,
311
314
  CANVAS_TEST_TYPE,
312
315
  IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
313
316
  mapSlotToPersonalizedVariations,
@@ -413,17 +416,41 @@ function renderComponent({
413
416
  slotChildrenCount,
414
417
  emptyPlaceholder
415
418
  }) {
416
- var _a, _b;
419
+ var _a, _b, _c;
417
420
  if (component.type === CANVAS_TEST_TYPE) {
418
421
  return renderTestComponent(
419
422
  component,
420
- (component2) => renderComponent({ component: component2, resolveRenderer })
423
+ (variantComponent) => {
424
+ var _a2, _b2;
425
+ return renderComponent({
426
+ component: variantComponent,
427
+ resolveRenderer,
428
+ parentComponent: component,
429
+ slotName: CANVAS_TEST_SLOT,
430
+ slotChildrenCount: (_a2 = component == null ? void 0 : component.slots) == null ? void 0 : _a2[CANVAS_TEST_SLOT].length,
431
+ indexInSlot: (_b2 = component == null ? void 0 : component.slots) == null ? void 0 : _b2[CANVAS_TEST_SLOT].findIndex(
432
+ ({ _id }) => variantComponent._id === _id
433
+ )
434
+ });
435
+ }
421
436
  );
422
437
  }
423
438
  if (component.type === CANVAS_PERSONALIZE_TYPE) {
424
439
  return renderPersonalizeComponent(
425
440
  component,
426
- (component2) => renderComponent({ component: component2, resolveRenderer })
441
+ (variantComponent) => {
442
+ var _a2, _b2;
443
+ return renderComponent({
444
+ component: variantComponent,
445
+ resolveRenderer,
446
+ parentComponent: component,
447
+ slotName: CANVAS_PERSONALIZE_SLOT,
448
+ slotChildrenCount: (_a2 = component == null ? void 0 : component.slots) == null ? void 0 : _a2[CANVAS_PERSONALIZE_SLOT].length,
449
+ indexInSlot: (_b2 = component == null ? void 0 : component.slots) == null ? void 0 : _b2[CANVAS_PERSONALIZE_SLOT].findIndex(
450
+ ({ _id }) => variantComponent._id === _id
451
+ )
452
+ });
453
+ }
427
454
  );
428
455
  }
429
456
  const resolvedComponent = resolveRenderer == null ? void 0 : resolveRenderer(component);
@@ -442,7 +469,8 @@ function renderComponent({
442
469
  "data-total-components": slotChildrenCount,
443
470
  "data-component-name": component.type,
444
471
  "data-is-placeholder": isPlaceholder ? "true" : void 0,
445
- "data-component-title": (_b = (_a = component.parameters) == null ? void 0 : _a.title) == null ? void 0 : _b.value
472
+ "data-is-localized": ((_a = component.parameters) == null ? void 0 : _a[CANVAS_LOCALE_TAG_PARAM]) ? "true" : void 0,
473
+ "data-component-title": (_c = (_b = component.parameters) == null ? void 0 : _b.title) == null ? void 0 : _c.value
446
474
  }),
447
475
  isPlaceholder && emptyPlaceholder !== void 0 ? emptyPlaceholder() : h4(resolvedComponent, props),
448
476
  h4("script", { "data-role": "component-end" })
package/dist/index.js CHANGED
@@ -425,17 +425,41 @@ function renderComponent({
425
425
  slotChildrenCount,
426
426
  emptyPlaceholder
427
427
  }) {
428
- var _a, _b;
428
+ var _a, _b, _c;
429
429
  if (component.type === import_canvas4.CANVAS_TEST_TYPE) {
430
430
  return renderTestComponent(
431
431
  component,
432
- (component2) => renderComponent({ component: component2, resolveRenderer })
432
+ (variantComponent) => {
433
+ var _a2, _b2;
434
+ return renderComponent({
435
+ component: variantComponent,
436
+ resolveRenderer,
437
+ parentComponent: component,
438
+ slotName: import_canvas4.CANVAS_TEST_SLOT,
439
+ slotChildrenCount: (_a2 = component == null ? void 0 : component.slots) == null ? void 0 : _a2[import_canvas4.CANVAS_TEST_SLOT].length,
440
+ indexInSlot: (_b2 = component == null ? void 0 : component.slots) == null ? void 0 : _b2[import_canvas4.CANVAS_TEST_SLOT].findIndex(
441
+ ({ _id }) => variantComponent._id === _id
442
+ )
443
+ });
444
+ }
433
445
  );
434
446
  }
435
447
  if (component.type === import_canvas4.CANVAS_PERSONALIZE_TYPE) {
436
448
  return renderPersonalizeComponent(
437
449
  component,
438
- (component2) => renderComponent({ component: component2, resolveRenderer })
450
+ (variantComponent) => {
451
+ var _a2, _b2;
452
+ return renderComponent({
453
+ component: variantComponent,
454
+ resolveRenderer,
455
+ parentComponent: component,
456
+ slotName: import_canvas4.CANVAS_PERSONALIZE_SLOT,
457
+ slotChildrenCount: (_a2 = component == null ? void 0 : component.slots) == null ? void 0 : _a2[import_canvas4.CANVAS_PERSONALIZE_SLOT].length,
458
+ indexInSlot: (_b2 = component == null ? void 0 : component.slots) == null ? void 0 : _b2[import_canvas4.CANVAS_PERSONALIZE_SLOT].findIndex(
459
+ ({ _id }) => variantComponent._id === _id
460
+ )
461
+ });
462
+ }
439
463
  );
440
464
  }
441
465
  const resolvedComponent = resolveRenderer == null ? void 0 : resolveRenderer(component);
@@ -454,7 +478,8 @@ function renderComponent({
454
478
  "data-total-components": slotChildrenCount,
455
479
  "data-component-name": component.type,
456
480
  "data-is-placeholder": isPlaceholder ? "true" : void 0,
457
- "data-component-title": (_b = (_a = component.parameters) == null ? void 0 : _a.title) == null ? void 0 : _b.value
481
+ "data-is-localized": ((_a = component.parameters) == null ? void 0 : _a[import_canvas4.CANVAS_LOCALE_TAG_PARAM]) ? "true" : void 0,
482
+ "data-component-title": (_c = (_b = component.parameters) == null ? void 0 : _b.title) == null ? void 0 : _c.value
458
483
  }),
459
484
  isPlaceholder && emptyPlaceholder !== void 0 ? emptyPlaceholder() : (0, import_vue_demi5.h)(resolvedComponent, props),
460
485
  (0, import_vue_demi5.h)("script", { "data-role": "component-end" })
package/dist/index.mjs CHANGED
@@ -307,7 +307,10 @@ var Composition = UniformComposition;
307
307
 
308
308
  // src/components/UniformSlot.ts
309
309
  import {
310
+ CANVAS_LOCALE_TAG_PARAM,
311
+ CANVAS_PERSONALIZE_SLOT,
310
312
  CANVAS_PERSONALIZE_TYPE,
313
+ CANVAS_TEST_SLOT,
311
314
  CANVAS_TEST_TYPE,
312
315
  IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
313
316
  mapSlotToPersonalizedVariations,
@@ -413,17 +416,41 @@ function renderComponent({
413
416
  slotChildrenCount,
414
417
  emptyPlaceholder
415
418
  }) {
416
- var _a, _b;
419
+ var _a, _b, _c;
417
420
  if (component.type === CANVAS_TEST_TYPE) {
418
421
  return renderTestComponent(
419
422
  component,
420
- (component2) => renderComponent({ component: component2, resolveRenderer })
423
+ (variantComponent) => {
424
+ var _a2, _b2;
425
+ return renderComponent({
426
+ component: variantComponent,
427
+ resolveRenderer,
428
+ parentComponent: component,
429
+ slotName: CANVAS_TEST_SLOT,
430
+ slotChildrenCount: (_a2 = component == null ? void 0 : component.slots) == null ? void 0 : _a2[CANVAS_TEST_SLOT].length,
431
+ indexInSlot: (_b2 = component == null ? void 0 : component.slots) == null ? void 0 : _b2[CANVAS_TEST_SLOT].findIndex(
432
+ ({ _id }) => variantComponent._id === _id
433
+ )
434
+ });
435
+ }
421
436
  );
422
437
  }
423
438
  if (component.type === CANVAS_PERSONALIZE_TYPE) {
424
439
  return renderPersonalizeComponent(
425
440
  component,
426
- (component2) => renderComponent({ component: component2, resolveRenderer })
441
+ (variantComponent) => {
442
+ var _a2, _b2;
443
+ return renderComponent({
444
+ component: variantComponent,
445
+ resolveRenderer,
446
+ parentComponent: component,
447
+ slotName: CANVAS_PERSONALIZE_SLOT,
448
+ slotChildrenCount: (_a2 = component == null ? void 0 : component.slots) == null ? void 0 : _a2[CANVAS_PERSONALIZE_SLOT].length,
449
+ indexInSlot: (_b2 = component == null ? void 0 : component.slots) == null ? void 0 : _b2[CANVAS_PERSONALIZE_SLOT].findIndex(
450
+ ({ _id }) => variantComponent._id === _id
451
+ )
452
+ });
453
+ }
427
454
  );
428
455
  }
429
456
  const resolvedComponent = resolveRenderer == null ? void 0 : resolveRenderer(component);
@@ -442,7 +469,8 @@ function renderComponent({
442
469
  "data-total-components": slotChildrenCount,
443
470
  "data-component-name": component.type,
444
471
  "data-is-placeholder": isPlaceholder ? "true" : void 0,
445
- "data-component-title": (_b = (_a = component.parameters) == null ? void 0 : _a.title) == null ? void 0 : _b.value
472
+ "data-is-localized": ((_a = component.parameters) == null ? void 0 : _a[CANVAS_LOCALE_TAG_PARAM]) ? "true" : void 0,
473
+ "data-component-title": (_c = (_b = component.parameters) == null ? void 0 : _b.title) == null ? void 0 : _c.value
446
474
  }),
447
475
  isPlaceholder && emptyPlaceholder !== void 0 ? emptyPlaceholder() : h4(resolvedComponent, props),
448
476
  h4("script", { "data-role": "component-end" })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-vue",
3
- "version": "18.16.0",
3
+ "version": "18.16.1-alpha.6+644024d8a",
4
4
  "description": "Vue SDK for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -22,7 +22,7 @@
22
22
  "format": "prettier --write \"src/**/*.{js,ts,tsx}\""
23
23
  },
24
24
  "dependencies": {
25
- "@uniformdev/canvas": "18.16.0",
25
+ "@uniformdev/canvas": "18.16.1-alpha.6+644024d8a",
26
26
  "@vue/test-utils": "2.2.10",
27
27
  "vue-demi": "^0.13.11"
28
28
  },
@@ -39,7 +39,7 @@
39
39
  "devDependencies": {
40
40
  "@testing-library/vue": "6.6.1",
41
41
  "@types/uuid": "9.0.0",
42
- "@uniformdev/context-vue": "18.16.0",
42
+ "@uniformdev/context-vue": "18.16.1-alpha.6+644024d8a",
43
43
  "@vue/server-test-utils": "1.3.0",
44
44
  "vue": "3.2.45",
45
45
  "vue-server-renderer": "2.7.14",
@@ -62,5 +62,5 @@
62
62
  "last 2 versions",
63
63
  "not dead"
64
64
  ],
65
- "gitHead": "debae7a8698824593e47c8886dcd6a5d4c4727a7"
65
+ "gitHead": "644024d8ad8a3f1f9341039c8813f03058068e9b"
66
66
  }