@uniformdev/canvas-vue 19.38.2 → 19.38.3-alpha.78
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.d.mts +24 -8
- package/dist/index.d.ts +24 -8
- package/dist/index.esm.js +70 -51
- package/dist/index.js +102 -82
- package/dist/index.mjs +70 -51
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -20,7 +20,7 @@ declare const DefaultNotImplementedComponent: vue_demi.DefineComponent<{
|
|
|
20
20
|
type: PropType<ComponentInstance>;
|
|
21
21
|
required: true;
|
|
22
22
|
};
|
|
23
|
-
}>>, {}>;
|
|
23
|
+
}>>, {}, {}>;
|
|
24
24
|
|
|
25
25
|
interface TestComponent {
|
|
26
26
|
slots?: {
|
|
@@ -115,7 +115,7 @@ declare const UniformText: vue_demi.DefineComponent<{
|
|
|
115
115
|
}>>, {
|
|
116
116
|
as: string | undefined;
|
|
117
117
|
isMultiline: boolean | undefined;
|
|
118
|
-
}>;
|
|
118
|
+
}, {}>;
|
|
119
119
|
|
|
120
120
|
type UniformComponentProps = {
|
|
121
121
|
/** A dynamic vue component that provides data to the Uniform Canvas SlotContent component via provide/inject */
|
|
@@ -411,7 +411,7 @@ declare const UniformComponent: vue_demi.DefineComponent<{
|
|
|
411
411
|
};
|
|
412
412
|
}>>, {
|
|
413
413
|
behaviorTracking: "onLoad" | "onView" | undefined;
|
|
414
|
-
}>;
|
|
414
|
+
}, {}>;
|
|
415
415
|
|
|
416
416
|
type UseUniformContextualEditingProps = {
|
|
417
417
|
initialCompositionValue?: Ref<RootComponentInstance | undefined>;
|
|
@@ -1518,7 +1518,23 @@ declare const UniformComposition: vue_demi.DefineComponent<{
|
|
|
1518
1518
|
};
|
|
1519
1519
|
}>>, {
|
|
1520
1520
|
behaviorTracking: "onLoad" | "onView" | undefined;
|
|
1521
|
-
}>;
|
|
1521
|
+
}, {}>;
|
|
1522
|
+
|
|
1523
|
+
type UniformPlaygroundProps = Pick<UniformCompositionProps, 'resolveRenderer'>;
|
|
1524
|
+
/**
|
|
1525
|
+
* Playground where you can freely live preview your components and pattern.
|
|
1526
|
+
*/
|
|
1527
|
+
declare const UniformPlayground: vue_demi.DefineComponent<{
|
|
1528
|
+
resolveRenderer: {
|
|
1529
|
+
type: PropType<ResolveRenderer | undefined>;
|
|
1530
|
+
};
|
|
1531
|
+
}, () => vue_demi.VNode<vue_demi.RendererNode, vue_demi.RendererElement, {
|
|
1532
|
+
[key: string]: any;
|
|
1533
|
+
}>, unknown, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<vue_demi.ExtractPropTypes<{
|
|
1534
|
+
resolveRenderer: {
|
|
1535
|
+
type: PropType<ResolveRenderer | undefined>;
|
|
1536
|
+
};
|
|
1537
|
+
}>>, {}, {}>;
|
|
1522
1538
|
|
|
1523
1539
|
type RichTextComponentProps<TNode extends RichTextNode = RichTextNode> = {
|
|
1524
1540
|
node: TNode;
|
|
@@ -1570,7 +1586,7 @@ declare const UniformRichText: vue_demi.DefineComponent<{
|
|
|
1570
1586
|
type: PropType<RenderRichTextComponentResolver | undefined>;
|
|
1571
1587
|
required: false;
|
|
1572
1588
|
};
|
|
1573
|
-
}>>, {}>;
|
|
1589
|
+
}>>, {}, {}>;
|
|
1574
1590
|
|
|
1575
1591
|
type UniformRichTextNodeProps = {
|
|
1576
1592
|
node: RichTextNode;
|
|
@@ -1596,7 +1612,7 @@ declare const UniformRichTextNode: vue_demi.DefineComponent<{
|
|
|
1596
1612
|
type: PropType<RenderRichTextComponentResolver | undefined>;
|
|
1597
1613
|
required: false;
|
|
1598
1614
|
};
|
|
1599
|
-
}>>, {}>;
|
|
1615
|
+
}>>, {}, {}>;
|
|
1600
1616
|
|
|
1601
1617
|
type UniformSlotProps = {
|
|
1602
1618
|
/** Name of the slot to render */
|
|
@@ -1626,7 +1642,7 @@ declare const UniformSlot: vue_demi.DefineComponent<{
|
|
|
1626
1642
|
resolveRenderer: {
|
|
1627
1643
|
type: PropType<ResolveRenderer | undefined>;
|
|
1628
1644
|
};
|
|
1629
|
-
}>>, {}>;
|
|
1645
|
+
}>>, {}, {}>;
|
|
1630
1646
|
|
|
1631
1647
|
type UseCompositionEventEffectOptions = Omit<Partial<SubscribeToCompositionOptions>, 'callback' | 'compositionId'> & {
|
|
1632
1648
|
compositionIdRef: Ref<SubscribeToCompositionOptions['compositionId']>;
|
|
@@ -1646,4 +1662,4 @@ declare const globalCompositionEnhancerInjectionKey = "uniformGlobalCompositionE
|
|
|
1646
1662
|
*/
|
|
1647
1663
|
declare function convertComponentToProps<T = unknown>(component: ComponentInstance): ComponentProps<T>;
|
|
1648
1664
|
|
|
1649
|
-
export { ComponentProps, DefaultNotImplementedComponent, DefaultNotImplementedComponentProps, HeadingRichTextNode, LinkRichTextNode, ListItemRichTextNode, ListRichTextNode, ParagraphRichTextNode, PersonalizeComponent, QuoteRichTextNode, RenderRichTextComponentResolver, ResolveRenderer, RichTextComponentProps, RichTextRendererComponent, RootRichTextNode, TestComponent, TextRichTextNode, UniformComponent, UniformComponentProps, UniformComposition, UniformCompositionProps, UniformRichText, UniformRichTextNode, UniformRichTextNodeProps, UniformRichTextProps, UniformSlot, UniformSlotProps, UniformText, UniformTextProps, UseCompositionEventEffectOptions, UseUniformContextualEditingProps, convertComponentToProps, globalCompositionEnhancerInjectionKey, useCompositionEventEffect, useUniformContextualEditing, useUniformCurrentComponent, useUniformCurrentComposition };
|
|
1665
|
+
export { ComponentProps, DefaultNotImplementedComponent, DefaultNotImplementedComponentProps, HeadingRichTextNode, LinkRichTextNode, ListItemRichTextNode, ListRichTextNode, ParagraphRichTextNode, PersonalizeComponent, QuoteRichTextNode, RenderRichTextComponentResolver, ResolveRenderer, RichTextComponentProps, RichTextRendererComponent, RootRichTextNode, TestComponent, TextRichTextNode, UniformComponent, UniformComponentProps, UniformComposition, UniformCompositionProps, UniformPlayground, UniformPlaygroundProps, UniformRichText, UniformRichTextNode, UniformRichTextNodeProps, UniformRichTextProps, UniformSlot, UniformSlotProps, UniformText, UniformTextProps, UseCompositionEventEffectOptions, UseUniformContextualEditingProps, convertComponentToProps, globalCompositionEnhancerInjectionKey, useCompositionEventEffect, useUniformContextualEditing, useUniformCurrentComponent, useUniformCurrentComposition };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare const DefaultNotImplementedComponent: vue_demi.DefineComponent<{
|
|
|
20
20
|
type: PropType<ComponentInstance>;
|
|
21
21
|
required: true;
|
|
22
22
|
};
|
|
23
|
-
}>>, {}>;
|
|
23
|
+
}>>, {}, {}>;
|
|
24
24
|
|
|
25
25
|
interface TestComponent {
|
|
26
26
|
slots?: {
|
|
@@ -115,7 +115,7 @@ declare const UniformText: vue_demi.DefineComponent<{
|
|
|
115
115
|
}>>, {
|
|
116
116
|
as: string | undefined;
|
|
117
117
|
isMultiline: boolean | undefined;
|
|
118
|
-
}>;
|
|
118
|
+
}, {}>;
|
|
119
119
|
|
|
120
120
|
type UniformComponentProps = {
|
|
121
121
|
/** A dynamic vue component that provides data to the Uniform Canvas SlotContent component via provide/inject */
|
|
@@ -411,7 +411,7 @@ declare const UniformComponent: vue_demi.DefineComponent<{
|
|
|
411
411
|
};
|
|
412
412
|
}>>, {
|
|
413
413
|
behaviorTracking: "onLoad" | "onView" | undefined;
|
|
414
|
-
}>;
|
|
414
|
+
}, {}>;
|
|
415
415
|
|
|
416
416
|
type UseUniformContextualEditingProps = {
|
|
417
417
|
initialCompositionValue?: Ref<RootComponentInstance | undefined>;
|
|
@@ -1518,7 +1518,23 @@ declare const UniformComposition: vue_demi.DefineComponent<{
|
|
|
1518
1518
|
};
|
|
1519
1519
|
}>>, {
|
|
1520
1520
|
behaviorTracking: "onLoad" | "onView" | undefined;
|
|
1521
|
-
}>;
|
|
1521
|
+
}, {}>;
|
|
1522
|
+
|
|
1523
|
+
type UniformPlaygroundProps = Pick<UniformCompositionProps, 'resolveRenderer'>;
|
|
1524
|
+
/**
|
|
1525
|
+
* Playground where you can freely live preview your components and pattern.
|
|
1526
|
+
*/
|
|
1527
|
+
declare const UniformPlayground: vue_demi.DefineComponent<{
|
|
1528
|
+
resolveRenderer: {
|
|
1529
|
+
type: PropType<ResolveRenderer | undefined>;
|
|
1530
|
+
};
|
|
1531
|
+
}, () => vue_demi.VNode<vue_demi.RendererNode, vue_demi.RendererElement, {
|
|
1532
|
+
[key: string]: any;
|
|
1533
|
+
}>, unknown, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<vue_demi.ExtractPropTypes<{
|
|
1534
|
+
resolveRenderer: {
|
|
1535
|
+
type: PropType<ResolveRenderer | undefined>;
|
|
1536
|
+
};
|
|
1537
|
+
}>>, {}, {}>;
|
|
1522
1538
|
|
|
1523
1539
|
type RichTextComponentProps<TNode extends RichTextNode = RichTextNode> = {
|
|
1524
1540
|
node: TNode;
|
|
@@ -1570,7 +1586,7 @@ declare const UniformRichText: vue_demi.DefineComponent<{
|
|
|
1570
1586
|
type: PropType<RenderRichTextComponentResolver | undefined>;
|
|
1571
1587
|
required: false;
|
|
1572
1588
|
};
|
|
1573
|
-
}>>, {}>;
|
|
1589
|
+
}>>, {}, {}>;
|
|
1574
1590
|
|
|
1575
1591
|
type UniformRichTextNodeProps = {
|
|
1576
1592
|
node: RichTextNode;
|
|
@@ -1596,7 +1612,7 @@ declare const UniformRichTextNode: vue_demi.DefineComponent<{
|
|
|
1596
1612
|
type: PropType<RenderRichTextComponentResolver | undefined>;
|
|
1597
1613
|
required: false;
|
|
1598
1614
|
};
|
|
1599
|
-
}>>, {}>;
|
|
1615
|
+
}>>, {}, {}>;
|
|
1600
1616
|
|
|
1601
1617
|
type UniformSlotProps = {
|
|
1602
1618
|
/** Name of the slot to render */
|
|
@@ -1626,7 +1642,7 @@ declare const UniformSlot: vue_demi.DefineComponent<{
|
|
|
1626
1642
|
resolveRenderer: {
|
|
1627
1643
|
type: PropType<ResolveRenderer | undefined>;
|
|
1628
1644
|
};
|
|
1629
|
-
}>>, {}>;
|
|
1645
|
+
}>>, {}, {}>;
|
|
1630
1646
|
|
|
1631
1647
|
type UseCompositionEventEffectOptions = Omit<Partial<SubscribeToCompositionOptions>, 'callback' | 'compositionId'> & {
|
|
1632
1648
|
compositionIdRef: Ref<SubscribeToCompositionOptions['compositionId']>;
|
|
@@ -1646,4 +1662,4 @@ declare const globalCompositionEnhancerInjectionKey = "uniformGlobalCompositionE
|
|
|
1646
1662
|
*/
|
|
1647
1663
|
declare function convertComponentToProps<T = unknown>(component: ComponentInstance): ComponentProps<T>;
|
|
1648
1664
|
|
|
1649
|
-
export { ComponentProps, DefaultNotImplementedComponent, DefaultNotImplementedComponentProps, HeadingRichTextNode, LinkRichTextNode, ListItemRichTextNode, ListRichTextNode, ParagraphRichTextNode, PersonalizeComponent, QuoteRichTextNode, RenderRichTextComponentResolver, ResolveRenderer, RichTextComponentProps, RichTextRendererComponent, RootRichTextNode, TestComponent, TextRichTextNode, UniformComponent, UniformComponentProps, UniformComposition, UniformCompositionProps, UniformRichText, UniformRichTextNode, UniformRichTextNodeProps, UniformRichTextProps, UniformSlot, UniformSlotProps, UniformText, UniformTextProps, UseCompositionEventEffectOptions, UseUniformContextualEditingProps, convertComponentToProps, globalCompositionEnhancerInjectionKey, useCompositionEventEffect, useUniformContextualEditing, useUniformCurrentComponent, useUniformCurrentComposition };
|
|
1665
|
+
export { ComponentProps, DefaultNotImplementedComponent, DefaultNotImplementedComponentProps, HeadingRichTextNode, LinkRichTextNode, ListItemRichTextNode, ListRichTextNode, ParagraphRichTextNode, PersonalizeComponent, QuoteRichTextNode, RenderRichTextComponentResolver, ResolveRenderer, RichTextComponentProps, RichTextRendererComponent, RootRichTextNode, TestComponent, TextRichTextNode, UniformComponent, UniformComponentProps, UniformComposition, UniformCompositionProps, UniformPlayground, UniformPlaygroundProps, UniformRichText, UniformRichTextNode, UniformRichTextNodeProps, UniformRichTextProps, UniformSlot, UniformSlotProps, UniformText, UniformTextProps, UseCompositionEventEffectOptions, UseUniformContextualEditingProps, convertComponentToProps, globalCompositionEnhancerInjectionKey, useCompositionEventEffect, useUniformContextualEditing, useUniformCurrentComponent, useUniformCurrentComposition };
|
package/dist/index.esm.js
CHANGED
|
@@ -295,25 +295,29 @@ var ContextualEditingComponentWrapper = defineComponent3({
|
|
|
295
295
|
var _a;
|
|
296
296
|
const { isContextualEditing } = useUniformCurrentComposition();
|
|
297
297
|
const isPlaceholder = ((_a = props.component) == null ? void 0 : _a._id) === PLACEHOLDER_ID;
|
|
298
|
+
const component = props.component;
|
|
298
299
|
return () => {
|
|
299
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l
|
|
300
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
300
301
|
return !(isContextualEditing == null ? void 0 : isContextualEditing.value) ? (_b = (_a2 = context.slots).default) == null ? void 0 : _b.call(_a2) : isPlaceholder && ((_d = (_c = context.slots).emptyPlaceholder) == null ? void 0 : _d.call(_c).length) === 0 ? [] : [
|
|
301
302
|
h3("script", {
|
|
302
303
|
"data-role": IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
|
|
303
304
|
"data-parent-id": (_e = props.parentComponent) == null ? void 0 : _e._id,
|
|
304
305
|
"data-parent-type": (_f = props.parentComponent) == null ? void 0 : _f.type,
|
|
305
|
-
"data-component-id":
|
|
306
|
+
"data-component-id": component == null ? void 0 : component._id,
|
|
306
307
|
"data-slot-name": props.slotName,
|
|
307
308
|
"data-component-index": props.indexInSlot,
|
|
308
309
|
"data-total-components": props.slotChildrenCount,
|
|
309
|
-
"data-component-name":
|
|
310
|
+
"data-component-name": component == null ? void 0 : component.type,
|
|
310
311
|
"data-is-placeholder": isPlaceholder ? "true" : void 0,
|
|
311
|
-
"data-is-localized": ((
|
|
312
|
+
"data-is-localized": ((_g = component == null ? void 0 : component.parameters) == null ? void 0 : _g[CANVAS_LOCALE_TAG_PARAM]) ? "true" : void 0,
|
|
312
313
|
// TODO: use a proper way to get the component's title, don't assume that it's always "title"
|
|
313
314
|
// https://linear.app/uniform/issue/UNI-937/show-the-right-component-title-in-the-highlighter
|
|
314
|
-
"data-component-title": (
|
|
315
|
+
"data-component-title": (_i = (_h = component == null ? void 0 : component.parameters) == null ? void 0 : _h.title) == null ? void 0 : _i.value,
|
|
316
|
+
// In preview mode if we are viewing a historic entry we do not want to allow
|
|
317
|
+
// the user to add a component to the composition or move the component around the page
|
|
318
|
+
"data-is-readonly": ((_j = component == null ? void 0 : component._contextualEditing) == null ? void 0 : _j.isEditable) ? void 0 : "true"
|
|
315
319
|
}),
|
|
316
|
-
isPlaceholder && context.slots.emptyPlaceholder !== void 0 ? context.slots.emptyPlaceholder() : (
|
|
320
|
+
isPlaceholder && context.slots.emptyPlaceholder !== void 0 ? context.slots.emptyPlaceholder() : (_l = (_k = context.slots).default) == null ? void 0 : _l.call(_k),
|
|
317
321
|
h3("script", { "data-role": IN_CONTEXT_EDITOR_COMPONENT_END_ROLE })
|
|
318
322
|
];
|
|
319
323
|
};
|
|
@@ -380,20 +384,37 @@ var UniformComposition = defineComponent4({
|
|
|
380
384
|
);
|
|
381
385
|
}
|
|
382
386
|
});
|
|
387
|
+
var UniformComposition_default = UniformComposition;
|
|
388
|
+
|
|
389
|
+
// src/components/UniformPlayground.ts
|
|
390
|
+
import { EMPTY_COMPOSITION as EMPTY_COMPOSITION2 } from "@uniformdev/canvas";
|
|
391
|
+
import { defineComponent as defineComponent5, h as h5 } from "vue-demi";
|
|
392
|
+
var UniformPlayground = defineComponent5({
|
|
393
|
+
name: "UniformPlayground",
|
|
394
|
+
inheritAttrs: false,
|
|
395
|
+
props: {
|
|
396
|
+
resolveRenderer: {
|
|
397
|
+
type: Object
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
setup(props) {
|
|
401
|
+
return () => h5(UniformComposition_default, { data: EMPTY_COMPOSITION2, resolveRenderer: props.resolveRenderer });
|
|
402
|
+
}
|
|
403
|
+
});
|
|
383
404
|
|
|
384
405
|
// src/components/UniformRichText/nodes/HeadingRichTextNode.ts
|
|
385
|
-
import { h as
|
|
406
|
+
import { h as h6 } from "vue-demi";
|
|
386
407
|
var HeadingRichTextNode = (props, context) => {
|
|
387
408
|
const { tag } = props.node;
|
|
388
|
-
return
|
|
409
|
+
return h6(tag != null ? tag : "h1", {}, context.slots);
|
|
389
410
|
};
|
|
390
411
|
|
|
391
412
|
// src/components/UniformRichText/nodes/LinkRichTextNode.ts
|
|
392
413
|
import { linkParamValueToHref } from "@uniformdev/richtext";
|
|
393
|
-
import { h as
|
|
414
|
+
import { h as h7 } from "vue-demi";
|
|
394
415
|
var LinkRichTextNode = (props, context) => {
|
|
395
416
|
const { link } = props.node;
|
|
396
|
-
return
|
|
417
|
+
return h7(
|
|
397
418
|
"a",
|
|
398
419
|
{
|
|
399
420
|
href: linkParamValueToHref(link)
|
|
@@ -403,10 +424,10 @@ var LinkRichTextNode = (props, context) => {
|
|
|
403
424
|
};
|
|
404
425
|
|
|
405
426
|
// src/components/UniformRichText/nodes/ListItemRichTextNode.ts
|
|
406
|
-
import { h as
|
|
427
|
+
import { h as h8 } from "vue-demi";
|
|
407
428
|
var ListItemRichTextNode = (props, context) => {
|
|
408
429
|
const { value } = props.node;
|
|
409
|
-
return
|
|
430
|
+
return h8(
|
|
410
431
|
"li",
|
|
411
432
|
{
|
|
412
433
|
value: Number.isFinite(value) && value > 0 ? value : void 0
|
|
@@ -416,18 +437,18 @@ var ListItemRichTextNode = (props, context) => {
|
|
|
416
437
|
};
|
|
417
438
|
|
|
418
439
|
// src/components/UniformRichText/nodes/ListRichTextNode.ts
|
|
419
|
-
import { h as
|
|
440
|
+
import { h as h9 } from "vue-demi";
|
|
420
441
|
var ListRichTextNode = (props, context) => {
|
|
421
442
|
const { tag } = props.node;
|
|
422
|
-
return
|
|
443
|
+
return h9(tag != null ? tag : "h1", {}, context.slots);
|
|
423
444
|
};
|
|
424
445
|
|
|
425
446
|
// src/components/UniformRichText/nodes/ParagraphRichTextNode.ts
|
|
426
447
|
import { isPureDirection, isPureTextAlign } from "@uniformdev/richtext";
|
|
427
|
-
import { h as
|
|
448
|
+
import { h as h10 } from "vue-demi";
|
|
428
449
|
var ParagraphRichTextNode = (props, context) => {
|
|
429
450
|
const { format, direction } = props.node;
|
|
430
|
-
return
|
|
451
|
+
return h10(
|
|
431
452
|
"p",
|
|
432
453
|
{
|
|
433
454
|
dir: isPureDirection(direction) ? direction : void 0,
|
|
@@ -438,61 +459,61 @@ var ParagraphRichTextNode = (props, context) => {
|
|
|
438
459
|
};
|
|
439
460
|
|
|
440
461
|
// src/components/UniformRichText/nodes/QuoteRichTextNode.ts
|
|
441
|
-
import { h as
|
|
462
|
+
import { h as h11 } from "vue-demi";
|
|
442
463
|
var QuoteRichTextNode = (_, context) => {
|
|
443
|
-
return
|
|
464
|
+
return h11("blockquote", {}, context.slots);
|
|
444
465
|
};
|
|
445
466
|
|
|
446
467
|
// src/components/UniformRichText/nodes/RootRichTextNode.ts
|
|
447
|
-
import { h as
|
|
468
|
+
import { h as h12 } from "vue-demi";
|
|
448
469
|
var RootRichTextNode = (props, c) => {
|
|
449
|
-
return
|
|
470
|
+
return h12(() => c.slots.default ? c.slots.default() : null);
|
|
450
471
|
};
|
|
451
472
|
|
|
452
473
|
// src/components/UniformRichText/nodes/TextRichTextNode.ts
|
|
453
474
|
import { getRichTextTagsFromTextFormat } from "@uniformdev/richtext";
|
|
454
|
-
import { h as
|
|
475
|
+
import { h as h13 } from "vue-demi";
|
|
455
476
|
var TextRichTextNode = (props) => {
|
|
456
477
|
const { format, text } = props.node;
|
|
457
478
|
const tags = getRichTextTagsFromTextFormat(format);
|
|
458
479
|
return tags.length > 0 ? tags.reduceRight(
|
|
459
480
|
(children, tag) => {
|
|
460
|
-
return
|
|
481
|
+
return h13(tag, null, children);
|
|
461
482
|
},
|
|
462
483
|
{
|
|
463
484
|
default: () => text
|
|
464
485
|
}
|
|
465
|
-
) :
|
|
486
|
+
) : h13(() => text);
|
|
466
487
|
};
|
|
467
488
|
|
|
468
489
|
// src/components/UniformRichText/UniformRichText.ts
|
|
469
490
|
import { isRichTextNode as isRichTextNode2 } from "@uniformdev/richtext";
|
|
470
|
-
import { computed as computed4, defineComponent as
|
|
491
|
+
import { computed as computed4, defineComponent as defineComponent7, h as h18 } from "vue-demi";
|
|
471
492
|
|
|
472
493
|
// src/components/UniformRichText/UniformRichTextNode.ts
|
|
473
494
|
import { isRichTextNode } from "@uniformdev/richtext";
|
|
474
|
-
import { defineComponent as
|
|
495
|
+
import { defineComponent as defineComponent6, h as h17 } from "vue-demi";
|
|
475
496
|
|
|
476
497
|
// src/components/UniformRichText/nodes/CodeRichTextNode.ts
|
|
477
|
-
import { h as
|
|
498
|
+
import { h as h14 } from "vue-demi";
|
|
478
499
|
var CodeRichTextNode = (_, context) => {
|
|
479
|
-
return
|
|
500
|
+
return h14("pre", {}, h14("code", {}, context.slots));
|
|
480
501
|
};
|
|
481
502
|
|
|
482
503
|
// src/components/UniformRichText/nodes/LinebreakRichTextNode.ts
|
|
483
|
-
import { h as
|
|
504
|
+
import { h as h15 } from "vue-demi";
|
|
484
505
|
var LinebreakRichTextNode = () => {
|
|
485
|
-
return
|
|
506
|
+
return h15("br", {});
|
|
486
507
|
};
|
|
487
508
|
|
|
488
509
|
// src/components/UniformRichText/nodes/TabRichTextNode.ts
|
|
489
|
-
import { h as
|
|
510
|
+
import { h as h16 } from "vue-demi";
|
|
490
511
|
var TabRichTextNode = () => {
|
|
491
|
-
return
|
|
512
|
+
return h16("", {}, " ");
|
|
492
513
|
};
|
|
493
514
|
|
|
494
515
|
// src/components/UniformRichText/UniformRichTextNode.ts
|
|
495
|
-
var UniformRichTextNode =
|
|
516
|
+
var UniformRichTextNode = defineComponent6({
|
|
496
517
|
name: "UniformRichTextNode",
|
|
497
518
|
props: {
|
|
498
519
|
node: {
|
|
@@ -517,13 +538,13 @@ var UniformRichTextNode = defineComponent5({
|
|
|
517
538
|
return () => null;
|
|
518
539
|
}
|
|
519
540
|
const children = node.children ? node.children.map(
|
|
520
|
-
(childNode) =>
|
|
541
|
+
(childNode) => h17(
|
|
521
542
|
UniformRichTextNode,
|
|
522
543
|
{ node: childNode, resolveRichTextRenderer: props.resolveRichTextRenderer },
|
|
523
544
|
context.slots
|
|
524
545
|
)
|
|
525
546
|
) : [];
|
|
526
|
-
return () =>
|
|
547
|
+
return () => h17(NodeRenderer, { node, children: h17(() => children) }, () => children);
|
|
527
548
|
}
|
|
528
549
|
});
|
|
529
550
|
var rendererMap = /* @__PURE__ */ new Map([
|
|
@@ -544,7 +565,7 @@ var resolveRichTextDefaultRenderer = (node) => {
|
|
|
544
565
|
};
|
|
545
566
|
|
|
546
567
|
// src/components/UniformRichText/UniformRichText.ts
|
|
547
|
-
var UniformRichText =
|
|
568
|
+
var UniformRichText = defineComponent7({
|
|
548
569
|
name: "UniformRichText",
|
|
549
570
|
props: {
|
|
550
571
|
parameterId: {
|
|
@@ -566,7 +587,7 @@ var UniformRichText = defineComponent6({
|
|
|
566
587
|
});
|
|
567
588
|
const root = (_a = value.value) == null ? void 0 : _a.root;
|
|
568
589
|
if (isRichTextNode2(root)) {
|
|
569
|
-
return () =>
|
|
590
|
+
return () => h18(
|
|
570
591
|
UniformRichTextNode,
|
|
571
592
|
{
|
|
572
593
|
node: root,
|
|
@@ -590,7 +611,7 @@ import {
|
|
|
590
611
|
mapSlotToTestVariations
|
|
591
612
|
} from "@uniformdev/canvas";
|
|
592
613
|
import { Personalize, Test } from "@uniformdev/context-vue";
|
|
593
|
-
import { computed as computed5, defineComponent as
|
|
614
|
+
import { computed as computed5, defineComponent as defineComponent8, h as h19 } from "vue-demi";
|
|
594
615
|
|
|
595
616
|
// src/helpers/convertComponentToProps.ts
|
|
596
617
|
function convertComponentToProps(component) {
|
|
@@ -615,7 +636,7 @@ function normalizePropName(name) {
|
|
|
615
636
|
}
|
|
616
637
|
|
|
617
638
|
// src/components/UniformSlot.ts
|
|
618
|
-
var UniformSlot =
|
|
639
|
+
var UniformSlot = defineComponent8({
|
|
619
640
|
name: "UniformSlot",
|
|
620
641
|
inheritAttrs: false,
|
|
621
642
|
props: {
|
|
@@ -661,7 +682,7 @@ function renderPersonalizeComponent(component, resolveRenderer) {
|
|
|
661
682
|
const parameters = component == null ? void 0 : component.parameters;
|
|
662
683
|
const processedVariants = mapSlotToPersonalizedVariations((_a = component.slots) == null ? void 0 : _a.pz);
|
|
663
684
|
const name = (_d = (_c = (_b = component.parameters) == null ? void 0 : _b.trackingEventName) == null ? void 0 : _c.value) != null ? _d : "Untitled Personalization";
|
|
664
|
-
return
|
|
685
|
+
return h19(Personalize, {
|
|
665
686
|
name,
|
|
666
687
|
// TODO: Fix the `as unknown`
|
|
667
688
|
component: (variant) => resolveRenderer(variant),
|
|
@@ -674,7 +695,7 @@ function renderTestComponent(component, resolveRenderer) {
|
|
|
674
695
|
const variants = (_b = (_a = component == null ? void 0 : component.slots) == null ? void 0 : _a.test) != null ? _b : [];
|
|
675
696
|
const testName = (_e = (_d = (_c = component == null ? void 0 : component.parameters) == null ? void 0 : _c.test) == null ? void 0 : _d.value) != null ? _e : "Untitled Test";
|
|
676
697
|
const finalVariants = mapSlotToTestVariations(variants);
|
|
677
|
-
return
|
|
698
|
+
return h19(Test, {
|
|
678
699
|
variations: finalVariants,
|
|
679
700
|
name: testName,
|
|
680
701
|
component: (variant) => resolveRenderer(variant)
|
|
@@ -728,13 +749,13 @@ function renderComponent({
|
|
|
728
749
|
const resolvedComponent = resolveRenderer == null ? void 0 : resolveRenderer(component);
|
|
729
750
|
if (resolvedComponent) {
|
|
730
751
|
const props = convertComponentToProps(component);
|
|
731
|
-
return
|
|
752
|
+
return h19(
|
|
732
753
|
UniformComponent,
|
|
733
754
|
{ data: component, resolveRenderer },
|
|
734
|
-
() =>
|
|
755
|
+
() => h19(
|
|
735
756
|
ContextualEditingComponentWrapper,
|
|
736
757
|
{ component, parentComponent, slotName, indexInSlot, slotChildrenCount },
|
|
737
|
-
{ default: () =>
|
|
758
|
+
{ default: () => h19(resolvedComponent, props), emptyPlaceholder }
|
|
738
759
|
)
|
|
739
760
|
);
|
|
740
761
|
}
|
|
@@ -742,7 +763,7 @@ function renderComponent({
|
|
|
742
763
|
`[canvas] found component of type '${component.type}' which the 'resolveRenderer' prop returned no component for. Nothing will be rendered. The resolveRenderer function may need to be extended to handle the new type.`,
|
|
743
764
|
component
|
|
744
765
|
);
|
|
745
|
-
return
|
|
766
|
+
return h19("");
|
|
746
767
|
}
|
|
747
768
|
|
|
748
769
|
// src/components/UniformText.ts
|
|
@@ -751,9 +772,9 @@ import {
|
|
|
751
772
|
ATTRIBUTE_PARAMETER_VALUE,
|
|
752
773
|
ATTRIBUTE_PLACEHOLDER
|
|
753
774
|
} from "@uniformdev/canvas";
|
|
754
|
-
import { computed as computed6, defineComponent as
|
|
775
|
+
import { computed as computed6, defineComponent as defineComponent9, h as h20, ref as ref2 } from "vue-demi";
|
|
755
776
|
var DEFAULT_ELEMENT_TYPE = "span";
|
|
756
|
-
var UniformText =
|
|
777
|
+
var UniformText = defineComponent9({
|
|
757
778
|
name: "UniformText",
|
|
758
779
|
inheritAttrs: true,
|
|
759
780
|
props: {
|
|
@@ -800,15 +821,12 @@ var UniformText = defineComponent8({
|
|
|
800
821
|
isFocused.value = false;
|
|
801
822
|
};
|
|
802
823
|
if (!parameter) {
|
|
803
|
-
console.warn(
|
|
804
|
-
`UniformText: The parameterId "${props.parameterId}" was not found in the component of type "${componentData == null ? void 0 : componentData.type}"`
|
|
805
|
-
);
|
|
806
824
|
return null;
|
|
807
825
|
}
|
|
808
826
|
if (!isContextualEditing) {
|
|
809
827
|
return () => {
|
|
810
828
|
var _a2, _b, _c, _d;
|
|
811
|
-
return
|
|
829
|
+
return h20(
|
|
812
830
|
(_a2 = props.as) != null ? _a2 : DEFAULT_ELEMENT_TYPE,
|
|
813
831
|
{ style: props.isMultiline ? { whiteSpace: "pre-wrap" } : {} },
|
|
814
832
|
(_d = (_c = (_b = context.slots).default) == null ? void 0 : _c.call(_b, value.value)) != null ? _d : value.value
|
|
@@ -819,7 +837,7 @@ var UniformText = defineComponent8({
|
|
|
819
837
|
const computedPlaceholder = typeof placeholderProp === "function" ? placeholderProp({ id: props.parameterId }) : placeholderProp;
|
|
820
838
|
return () => {
|
|
821
839
|
var _a2, _b, _c, _d, _e;
|
|
822
|
-
return
|
|
840
|
+
return h20(
|
|
823
841
|
(_a2 = props.as) != null ? _a2 : DEFAULT_ELEMENT_TYPE,
|
|
824
842
|
{
|
|
825
843
|
...getParameterAttributes({
|
|
@@ -891,6 +909,7 @@ export {
|
|
|
891
909
|
TextRichTextNode,
|
|
892
910
|
UniformComponent,
|
|
893
911
|
UniformComposition,
|
|
912
|
+
UniformPlayground,
|
|
894
913
|
UniformRichText,
|
|
895
914
|
UniformRichTextNode,
|
|
896
915
|
UniformSlot,
|