@makeswift/runtime 0.12.1 → 0.12.2

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.
@@ -276,16 +276,26 @@ function reducer$1(state = getInitialState(), action) {
276
276
  return state;
277
277
  }
278
278
  }
279
+ const ControlDataTypeKey = "@@makeswift/type";
280
+ const ColorControlDataTypeKey = ControlDataTypeKey;
281
+ const ColorControlDataTypeValueV1 = "color::v1";
279
282
  const ColorControlType = "makeswift::controls::color";
280
283
  function Color(config = {}) {
281
- return { type: ColorControlType, config };
284
+ return { type: ColorControlType, config, version: 1 };
282
285
  }
283
286
  function copyColorData(value, context) {
284
- var _a;
285
287
  if (value == null)
286
288
  return value;
287
- return __spreadProps(__spreadValues({}, value), {
288
- swatchId: (_a = context.replacementContext.swatchIds.get(value.swatchId)) != null ? _a : value.swatchId
289
+ return match(value).with({ [ControlDataTypeKey]: ColorControlDataTypeValueV1 }, (val) => {
290
+ var _a;
291
+ return __spreadProps(__spreadValues({}, val), {
292
+ swatchId: (_a = context.replacementContext.swatchIds.get(val.swatchId)) != null ? _a : val.swatchId
293
+ });
294
+ }).otherwise((val) => {
295
+ var _a;
296
+ return __spreadProps(__spreadValues({}, val), {
297
+ swatchId: (_a = context.replacementContext.swatchIds.get(val.swatchId)) != null ? _a : val.swatchId
298
+ });
289
299
  });
290
300
  }
291
301
  class PropController {
@@ -5110,5 +5120,5 @@ function configureStore({
5110
5120
  breakpoints: getInitialState$8(breakpoints != null ? breakpoints : preloadedState == null ? void 0 : preloadedState.breakpoints)
5111
5121
  }), applyMiddleware(thunk));
5112
5122
  }
5113
- export { getBorderSwatchIds as $, TextStyle as A, Backgrounds as B, ComponentIcon as C, Date as D, ElementID as E, Font as F, GapY as G, ResponsiveLength as H, Images as I, TextArea$1 as J, Table as K, Link$1 as L, Margin as M, Number as N, TableFormFields as O, Padding as P, Image$1 as Q, RichTextPropControllerMessageType as R, Shadows as S, TableFormFieldsMessageType as T, ResponsiveOpacity as U, NavigationLinks as V, Width as W, SocialLinks as X, RichText as Y, Video as Z, useStyle as _, copy$9 as a, getListTypographyIds as a$, getBoxShadowsSwatchIds as a0, getResponsiveColorSwatchIds as a1, StyleControlProperty as a2, ImageControlValueFormat as a3, isPropControllersHandle as a4, isRichTextV1Data as a5, isNonNullable as a6, TypographyControlType as a7, StyleControlType as a8, RichTextV2ControlType as a9, getDocument as aA, getElementId as aB, getIsInBuilder as aC, getReactComponent as aD, getBuilderEditMode as aE, getIsPreview as aF, getBackgroundsFileIds as aG, getBackgroundsSwatchIds as aH, Color as aI, copyColorData as aJ, copy as aK, merge as aL, getTranslatableData as aM, mergeTranslatedData as aN, unstable_IconRadioGroupIcon as aO, unstable_IconRadioGroup as aP, Image as aQ, copyImageData as aR, Link as aS, copyLinkData as aT, List as aU, ListControlMessageType as aV, ListControl as aW, copyListData as aX, getListElementChildren as aY, getListSwatchIds as aZ, getListFileIds as a_, RichTextControlType as aa, SlotControlType as ab, StyleV2ControlType as ac, ListControlType as ad, ShapeControlType as ae, LinkControlType as af, ImageControlType as ag, IconRadioGroupControlType as ah, ColorControlType as ai, SelectControlType as aj, TextAreaControlType as ak, TextInputControlType as al, getComponentPropControllerDescriptors as am, getPropControllers as an, Types as ao, BorderPropControllerFormat as ap, ShadowsPropControllerFormat as aq, BorderRadiusPropControllerFormat as ar, MarginPropControllerFormat as as, PaddingPropControllerFormat as at, WidthPropControllerFormat as au, configureStore as av, copyElementTree as aw, getBreakpoints as ax, getElementTreeTranslatableData as ay, mergeElementTreeTranslatedData as az, copy$8 as b, InlineType as b$, getListPageIds as b0, getListTranslatableData as b1, mergeListTranslatedData as b2, Select as b3, Shape as b4, ShapeControlMessageType as b5, ShapeControl as b6, copyShapeData as b7, getShapeElementChildren as b8, getShapeSwatchIds as b9, richTextDTOtoDAO as bA, toSelectionDTO as bB, richTextDAOToDTO as bC, RichTextV2Mode as bD, RichTextV2ControlMessageType as bE, RichTextV2Control as bF, richTextV2DataToDescendents as bG, richTextV2DescendentsToData as bH, createRichTextV2Plugin as bI, unstable_Typography as bJ, getTypographySwatchIds as bK, getTypographyTypographyIds as bL, TypographyActions as bM, TYPOGRAPHY_KEY as bN, withTypography as bO, TypographyPlugin as bP, BlockActions as bQ, ListActions as bR, onKeyDown as bS, withBlock as bT, BlockPlugin as bU, withInlineMode as bV, InlineModePlugin as bW, withTextAlign as bX, TextAlignPlugin as bY, RootBlockType as bZ, BlockType as b_, getShapeTypographyIds as ba, getShapePageIds as bb, getShapeFileIds as bc, getShapeTranslatableData as bd, mergeShapeTranslatedData as be, Slot as bf, SlotControlMessageType as bg, SlotControl as bh, copySlotData as bi, mergeSlotData as bj, mergeSlotControlTranslatedData as bk, Style as bl, StyleControlMessageType as bm, StyleControl as bn, copyStyleData as bo, unstable_useStyleV2ClassName as bp, unstable_StyleV2 as bq, StyleV2ControlMessageType as br, StyleV2Control as bs, TextArea as bt, TextInput as bu, copyRichTextData as bv, ObjectType as bw, RichTextControlMessageType as bx, RichTextControl as by, richTextDTOtoSelection as bz, createDocument as c, BlockTextAlignment as c0, withInline as c1, InlinePlugin as c2, ElementUtils as c3, onChange$1 as c4, getValue$3 as c5, isLinkElement as c6, getInitialState$6 as c7, reducer$7 as c8, getDocument$1 as c9, getComponentsMeta as ca, getComponentPropControllerDescriptors$1 as cb, BuilderEditMode as cc, getDocumentKeysSortedByDepth as cd, getPropController as ce, getPropControllersHandle as cf, getElement as cg, getElementPropControllerDescriptors as ch, createPropController as ci, reducer$6 as cj, reducer$8 as ck, reducer$5 as cl, reducer$4 as cm, reducer$3 as cn, reducer$2 as co, reducer$1 as cp, getInitialState$1 as cq, descriptors as d, copy$e as e, deepEqual as f, createDocumentReference as g, getPropControllerDescriptors as h, introspection as i, isElementReference as j, getSwatchIds as k, getFileIds as l, getTypographyIds as m, getTableIds as n, getPageIds as o, getElementChildren as p, ResponsiveIconRadioGroup as q, Border as r, BorderRadius as s, GapX as t, ResponsiveSelect as u, ResponsiveNumber as v, Checkbox as w, Grid as x, TextInput$1 as y, ResponsiveColor as z };
5123
+ export { getBorderSwatchIds as $, TextStyle as A, Backgrounds as B, ComponentIcon as C, Date as D, ElementID as E, Font as F, GapY as G, ResponsiveLength as H, Images as I, TextArea$1 as J, Table as K, Link$1 as L, Margin as M, Number as N, TableFormFields as O, Padding as P, Image$1 as Q, RichTextPropControllerMessageType as R, Shadows as S, TableFormFieldsMessageType as T, ResponsiveOpacity as U, NavigationLinks as V, Width as W, SocialLinks as X, RichText as Y, Video as Z, useStyle as _, copy$9 as a, getListElementChildren as a$, getBoxShadowsSwatchIds as a0, getResponsiveColorSwatchIds as a1, StyleControlProperty as a2, ImageControlValueFormat as a3, isPropControllersHandle as a4, isRichTextV1Data as a5, isNonNullable as a6, TypographyControlType as a7, StyleControlType as a8, RichTextV2ControlType as a9, getDocument as aA, getElementId as aB, getIsInBuilder as aC, getReactComponent as aD, getBuilderEditMode as aE, getIsPreview as aF, getBackgroundsFileIds as aG, getBackgroundsSwatchIds as aH, ControlDataTypeKey as aI, ColorControlDataTypeKey as aJ, ColorControlDataTypeValueV1 as aK, Color as aL, copyColorData as aM, copy as aN, merge as aO, getTranslatableData as aP, mergeTranslatedData as aQ, unstable_IconRadioGroupIcon as aR, unstable_IconRadioGroup as aS, Image as aT, copyImageData as aU, Link as aV, copyLinkData as aW, List as aX, ListControlMessageType as aY, ListControl as aZ, copyListData as a_, RichTextControlType as aa, SlotControlType as ab, StyleV2ControlType as ac, ListControlType as ad, ShapeControlType as ae, LinkControlType as af, ImageControlType as ag, IconRadioGroupControlType as ah, ColorControlType as ai, SelectControlType as aj, TextAreaControlType as ak, TextInputControlType as al, getComponentPropControllerDescriptors as am, getPropControllers as an, Types as ao, BorderPropControllerFormat as ap, ShadowsPropControllerFormat as aq, BorderRadiusPropControllerFormat as ar, MarginPropControllerFormat as as, PaddingPropControllerFormat as at, WidthPropControllerFormat as au, configureStore as av, copyElementTree as aw, getBreakpoints as ax, getElementTreeTranslatableData as ay, mergeElementTreeTranslatedData as az, copy$8 as b, TextAlignPlugin as b$, getListSwatchIds as b0, getListFileIds as b1, getListTypographyIds as b2, getListPageIds as b3, getListTranslatableData as b4, mergeListTranslatedData as b5, Select as b6, Shape as b7, ShapeControlMessageType as b8, ShapeControl as b9, RichTextControlMessageType as bA, RichTextControl as bB, richTextDTOtoSelection as bC, richTextDTOtoDAO as bD, toSelectionDTO as bE, richTextDAOToDTO as bF, RichTextV2Mode as bG, RichTextV2ControlMessageType as bH, RichTextV2Control as bI, richTextV2DataToDescendents as bJ, richTextV2DescendentsToData as bK, createRichTextV2Plugin as bL, unstable_Typography as bM, getTypographySwatchIds as bN, getTypographyTypographyIds as bO, TypographyActions as bP, TYPOGRAPHY_KEY as bQ, withTypography as bR, TypographyPlugin as bS, BlockActions as bT, ListActions as bU, onKeyDown as bV, withBlock as bW, BlockPlugin as bX, withInlineMode as bY, InlineModePlugin as bZ, withTextAlign as b_, copyShapeData as ba, getShapeElementChildren as bb, getShapeSwatchIds as bc, getShapeTypographyIds as bd, getShapePageIds as be, getShapeFileIds as bf, getShapeTranslatableData as bg, mergeShapeTranslatedData as bh, Slot as bi, SlotControlMessageType as bj, SlotControl as bk, copySlotData as bl, mergeSlotData as bm, mergeSlotControlTranslatedData as bn, Style as bo, StyleControlMessageType as bp, StyleControl as bq, copyStyleData as br, unstable_useStyleV2ClassName as bs, unstable_StyleV2 as bt, StyleV2ControlMessageType as bu, StyleV2Control as bv, TextArea as bw, TextInput as bx, copyRichTextData as by, ObjectType as bz, createDocument as c, RootBlockType as c0, BlockType as c1, InlineType as c2, BlockTextAlignment as c3, withInline as c4, InlinePlugin as c5, ElementUtils as c6, onChange$1 as c7, getValue$3 as c8, isLinkElement as c9, getInitialState$6 as ca, reducer$7 as cb, getDocument$1 as cc, getComponentsMeta as cd, getComponentPropControllerDescriptors$1 as ce, BuilderEditMode as cf, getDocumentKeysSortedByDepth as cg, getPropController as ch, getPropControllersHandle as ci, getElement as cj, getElementPropControllerDescriptors as ck, createPropController as cl, reducer$6 as cm, reducer$8 as cn, reducer$5 as co, reducer$4 as cp, reducer$3 as cq, reducer$2 as cr, reducer$1 as cs, getInitialState$1 as ct, descriptors as d, copy$e as e, deepEqual as f, createDocumentReference as g, getPropControllerDescriptors as h, introspection as i, isElementReference as j, getSwatchIds as k, getFileIds as l, getTypographyIds as m, getTableIds as n, getPageIds as o, getElementChildren as p, ResponsiveIconRadioGroup as q, Border as r, BorderRadius as s, GapX as t, ResponsiveSelect as u, ResponsiveNumber as v, Checkbox as w, Grid as x, TextInput$1 as y, ResponsiveColor as z };
5114
5124
  //# sourceMappingURL=react-page.es.js.map