@makeswift/prop-controllers 0.0.0-snapshot-20240820222115 → 0.0.0-snapshot-20240821005020

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.
Files changed (65) hide show
  1. package/dist/cjs/backgrounds/backgrounds.js +0 -297
  2. package/dist/cjs/backgrounds/index.js +0 -23
  3. package/dist/cjs/border/border.js +0 -132
  4. package/dist/cjs/border/index.js +0 -23
  5. package/dist/cjs/border-radius/border-radius.js +0 -82
  6. package/dist/cjs/border-radius/index.js +0 -23
  7. package/dist/cjs/checkbox/checkbox.js +0 -68
  8. package/dist/cjs/checkbox/index.js +0 -23
  9. package/dist/cjs/data.js +0 -85
  10. package/dist/cjs/date/date.js +0 -68
  11. package/dist/cjs/date/index.js +0 -23
  12. package/dist/cjs/element-id/element-id.js +0 -90
  13. package/dist/cjs/element-id/index.js +0 -23
  14. package/dist/cjs/font/font.js +0 -70
  15. package/dist/cjs/font/index.js +0 -23
  16. package/dist/cjs/gap-x/gap-x.js +0 -40
  17. package/dist/cjs/gap-x/index.js +0 -23
  18. package/dist/cjs/gap-y/gap-y.js +0 -68
  19. package/dist/cjs/gap-y/index.js +0 -23
  20. package/dist/cjs/grid/grid.js +0 -130
  21. package/dist/cjs/grid/index.js +0 -23
  22. package/dist/cjs/image/image.js +0 -95
  23. package/dist/cjs/image/index.js +0 -23
  24. package/dist/cjs/images/images.js +0 -147
  25. package/dist/cjs/images/index.js +0 -23
  26. package/dist/cjs/index.js +0 -343
  27. package/dist/cjs/link/index.js +0 -23
  28. package/dist/cjs/margin/index.js +0 -23
  29. package/dist/cjs/navigation-links/index.js +0 -23
  30. package/dist/cjs/padding/index.js +0 -23
  31. package/dist/cjs/responsive-number/responsive-number.js +0 -40
  32. package/dist/cjs/versioned.js.map +0 -1
  33. package/dist/esm/gap-y/index.js.map +0 -1
  34. package/dist/esm/grid/index.js.map +0 -1
  35. package/dist/esm/image/index.js.map +0 -1
  36. package/dist/esm/images/index.js.map +0 -1
  37. package/dist/esm/link/index.js.map +0 -1
  38. package/dist/esm/link/link.js.map +0 -1
  39. package/dist/esm/margin/index.js.map +0 -1
  40. package/dist/esm/margin/margin.js.map +0 -1
  41. package/dist/esm/navigation-links/index.js.map +0 -1
  42. package/dist/esm/navigation-links/navigation-links.js.map +0 -1
  43. package/dist/esm/number.js.map +0 -1
  44. package/dist/esm/padding/index.js.map +0 -1
  45. package/dist/esm/padding/padding.js.map +0 -1
  46. package/dist/esm/prop-controllers.js.map +0 -1
  47. package/dist/esm/responsive-color.js.map +0 -1
  48. package/dist/esm/responsive-icon-radio-group/index.js.map +0 -1
  49. package/dist/esm/responsive-icon-radio-group/responsive-icon-radio-group.js.map +0 -1
  50. package/dist/esm/responsive-length.js.map +0 -1
  51. package/dist/esm/responsive-number/index.js.map +0 -1
  52. package/dist/esm/responsive-number/responsive-number.js.map +0 -1
  53. package/dist/esm/responsive-opacity/index.js.map +0 -1
  54. package/dist/esm/responsive-opacity/responsive-opacity.js.map +0 -1
  55. package/dist/esm/responsive-select/index.js.map +0 -1
  56. package/dist/esm/responsive-select/responsive-select.js.map +0 -1
  57. package/dist/esm/shadows.js.map +0 -1
  58. package/dist/esm/social-links/index.js.map +0 -1
  59. package/dist/esm/table/index.js.map +0 -1
  60. package/dist/esm/table-form-fields/index.js.map +0 -1
  61. package/dist/esm/text-area/index.js.map +0 -1
  62. package/dist/esm/text-input/index.js.map +0 -1
  63. package/dist/esm/text-style/index.js.map +0 -1
  64. package/dist/esm/width/index.js.map +0 -1
  65. package/package.json +2 -2
package/dist/cjs/data.js CHANGED
@@ -1,85 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var data_exports = {};
20
- __export(data_exports, {
21
- colorDataSchema: () => colorDataSchema,
22
- gapDataSchema: () => gapDataSchema,
23
- imageDataSchema: () => imageDataSchema,
24
- imageDataV0Schema: () => imageDataV0Schema,
25
- imageDataV1Schema: () => imageDataV1Schema,
26
- lengthDataSchema: () => lengthDataSchema,
27
- responsiveGapDataSchema: () => responsiveGapDataSchema,
28
- responsiveIconRadioGroupValueSchema: () => responsiveIconRadioGroupValueSchema,
29
- responsiveNumberValueSchema: () => responsiveNumberValueSchema,
30
- responsiveSelectValueSchema: () => responsiveSelectValueSchema
31
- });
32
- module.exports = __toCommonJS(data_exports);
33
- var import_zod = require("zod");
34
- var import_prop_controllers = require("./prop-controllers");
35
- const colorDataSchema = import_zod.z.object({
36
- swatchId: import_zod.z.string(),
37
- alpha: import_zod.z.number()
38
- });
39
- const lengthDataSchema = import_zod.z.object({
40
- value: import_zod.z.number(),
41
- unit: import_zod.z.enum(["px", "%"])
42
- });
43
- const gapDataSchema = import_zod.z.object({
44
- value: import_zod.z.number(),
45
- unit: import_zod.z.literal("px")
46
- });
47
- const responsiveGapDataSchema = import_prop_controllers.Schema.responsiveValue(gapDataSchema);
48
- const fileIdSchema = import_zod.z.string();
49
- const imageDataV0Schema = fileIdSchema;
50
- const imageDataV1MakeswiftFileSchema = import_zod.z.object({
51
- version: import_zod.z.literal(1),
52
- type: import_zod.z.literal("makeswift-file"),
53
- id: import_zod.z.string()
54
- });
55
- const imageDataV1ExternalFileSchema = import_zod.z.object({
56
- version: import_zod.z.literal(1),
57
- type: import_zod.z.literal("external-file"),
58
- url: import_zod.z.string(),
59
- width: import_zod.z.number().nullable().optional(),
60
- height: import_zod.z.number().nullable().optional()
61
- });
62
- const imageDataV1Schema = import_zod.z.union([
63
- imageDataV1MakeswiftFileSchema,
64
- imageDataV1ExternalFileSchema
65
- ]);
66
- const imageDataSchema = import_zod.z.union([imageDataV0Schema, imageDataV1Schema]);
67
- const responsiveNumberValueSchema = import_prop_controllers.Schema.responsiveValue(import_zod.z.number());
68
- const responsiveSelectValueSchema = import_prop_controllers.Schema.responsiveValue(import_zod.z.string());
69
- const responsiveIconRadioGroupValueSchema = import_prop_controllers.Schema.responsiveValue(
70
- import_zod.z.string()
71
- );
72
- // Annotate the CommonJS export names for ESM import in node:
73
- 0 && (module.exports = {
74
- colorDataSchema,
75
- gapDataSchema,
76
- imageDataSchema,
77
- imageDataV0Schema,
78
- imageDataV1Schema,
79
- lengthDataSchema,
80
- responsiveGapDataSchema,
81
- responsiveIconRadioGroupValueSchema,
82
- responsiveNumberValueSchema,
83
- responsiveSelectValueSchema
84
- });
85
- //# sourceMappingURL=data.js.map
@@ -1,68 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var date_exports = {};
20
- __export(date_exports, {
21
- Date: () => Date,
22
- DatePropControllerDataV1Type: () => DatePropControllerDataV1Type,
23
- createDatePropControllerDataFromString: () => createDatePropControllerDataFromString,
24
- datePropControllerDataSchema: () => datePropControllerDataSchema,
25
- getDatePropControllerDataString: () => getDatePropControllerDataString
26
- });
27
- module.exports = __toCommonJS(date_exports);
28
- var import_zod = require("zod");
29
- var import_prop_controllers = require("../prop-controllers");
30
- var import_ts_pattern = require("ts-pattern");
31
- const datePropControllerDataV0Schema = import_zod.z.string();
32
- const DatePropControllerDataV1Type = "prop-controllers::date::v1";
33
- const datePropControllerDataV1Schema = import_zod.z.object({
34
- [import_prop_controllers.ControlDataTypeKey]: import_zod.z.literal(DatePropControllerDataV1Type),
35
- value: import_zod.z.string()
36
- });
37
- const datePropControllerDataSchema = import_zod.z.union([
38
- datePropControllerDataV0Schema,
39
- datePropControllerDataV1Schema
40
- ]);
41
- function Date(options = {}) {
42
- return { type: import_prop_controllers.Types.Date, version: 1, options };
43
- }
44
- function getDatePropControllerDataString(data) {
45
- return (0, import_ts_pattern.match)(data).with(
46
- { [import_prop_controllers.ControlDataTypeKey]: DatePropControllerDataV1Type },
47
- (v1) => v1.value
48
- ).otherwise((v0) => v0);
49
- }
50
- function createDatePropControllerDataFromString(value, definition) {
51
- return (0, import_ts_pattern.match)(definition).with(
52
- { version: 1 },
53
- import_ts_pattern.P.nullish,
54
- () => ({
55
- [import_prop_controllers.ControlDataTypeKey]: DatePropControllerDataV1Type,
56
- value
57
- })
58
- ).otherwise(() => value);
59
- }
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- Date,
63
- DatePropControllerDataV1Type,
64
- createDatePropControllerDataFromString,
65
- datePropControllerDataSchema,
66
- getDatePropControllerDataString
67
- });
68
- //# sourceMappingURL=date.js.map
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var date_exports = {};
17
- module.exports = __toCommonJS(date_exports);
18
- __reExport(date_exports, require("./date"), module.exports);
19
- // Annotate the CommonJS export names for ESM import in node:
20
- 0 && (module.exports = {
21
- ...require("./date")
22
- });
23
- //# sourceMappingURL=index.js.map
@@ -1,90 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var element_id_exports = {};
20
- __export(element_id_exports, {
21
- ElementID: () => ElementID,
22
- ElementIDPropControllerDataV1Type: () => ElementIDPropControllerDataV1Type,
23
- copyElementIDPropControllerData: () => copyElementIDPropControllerData,
24
- createElementIDPropControllerDataFromElementID: () => createElementIDPropControllerDataFromElementID,
25
- elementIDPropControllerDataSchema: () => elementIDPropControllerDataSchema,
26
- getElementIDPropControllerDataElementID: () => getElementIDPropControllerDataElementID
27
- });
28
- module.exports = __toCommonJS(element_id_exports);
29
- var import_zod = require("zod");
30
- var import_prop_controllers = require("../prop-controllers");
31
- var import_ts_pattern = require("ts-pattern");
32
- const elementIDSchema = import_zod.z.string();
33
- const elementIDPropControllerDataV0Schema = elementIDSchema;
34
- const ElementIDPropControllerDataV1Type = "prop-controllers::element-id::v1";
35
- const elementIDPropControllerDataV1Schema = import_zod.z.object({
36
- [import_prop_controllers.ControlDataTypeKey]: import_zod.z.literal(ElementIDPropControllerDataV1Type),
37
- value: elementIDSchema
38
- });
39
- const elementIDPropControllerDataSchema = import_zod.z.union([
40
- elementIDPropControllerDataV0Schema,
41
- elementIDPropControllerDataV1Schema
42
- ]);
43
- function ElementID(options = {}) {
44
- return { type: import_prop_controllers.Types.ElementID, version: 1, options };
45
- }
46
- function getElementIDPropControllerDataElementID(data) {
47
- return (0, import_ts_pattern.match)(data).with(
48
- { [import_prop_controllers.ControlDataTypeKey]: ElementIDPropControllerDataV1Type },
49
- (v1) => v1.value
50
- ).otherwise((v0) => v0);
51
- }
52
- function createElementIDPropControllerDataFromElementID(value, definition) {
53
- return (0, import_ts_pattern.match)(definition).with(
54
- { version: 1 },
55
- import_ts_pattern.P.nullish,
56
- () => ({
57
- [import_prop_controllers.ControlDataTypeKey]: ElementIDPropControllerDataV1Type,
58
- value
59
- })
60
- ).otherwise(() => value);
61
- }
62
- function copyElementID(data, context) {
63
- if (data == null)
64
- return data;
65
- if (context.replacementContext.elementHtmlIds.has(data))
66
- return void 0;
67
- context.replacementContext.elementHtmlIds.add(data);
68
- return data;
69
- }
70
- function copyElementIDPropControllerData(data, context) {
71
- return (0, import_ts_pattern.match)(data).with(void 0, () => void 0).with({ [import_prop_controllers.ControlDataTypeKey]: ElementIDPropControllerDataV1Type }, (v1) => {
72
- const value = copyElementID(v1.value, context);
73
- if (value == null)
74
- return void 0;
75
- return {
76
- [import_prop_controllers.ControlDataTypeKey]: ElementIDPropControllerDataV1Type,
77
- value
78
- };
79
- }).otherwise((v0) => copyElementID(v0, context));
80
- }
81
- // Annotate the CommonJS export names for ESM import in node:
82
- 0 && (module.exports = {
83
- ElementID,
84
- ElementIDPropControllerDataV1Type,
85
- copyElementIDPropControllerData,
86
- createElementIDPropControllerDataFromElementID,
87
- elementIDPropControllerDataSchema,
88
- getElementIDPropControllerDataElementID
89
- });
90
- //# sourceMappingURL=element-id.js.map
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var element_id_exports = {};
17
- module.exports = __toCommonJS(element_id_exports);
18
- __reExport(element_id_exports, require("./element-id"), module.exports);
19
- // Annotate the CommonJS export names for ESM import in node:
20
- 0 && (module.exports = {
21
- ...require("./element-id")
22
- });
23
- //# sourceMappingURL=index.js.map
@@ -1,70 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var font_exports = {};
20
- __export(font_exports, {
21
- Font: () => Font,
22
- FontPropControllerDataV1Type: () => FontPropControllerDataV1Type,
23
- createFontPropControllerDataFromResponsiveFontData: () => createFontPropControllerDataFromResponsiveFontData,
24
- fontPropControllerDataSchema: () => fontPropControllerDataSchema,
25
- getFontPropControllerDataResponsiveFontData: () => getFontPropControllerDataResponsiveFontData
26
- });
27
- module.exports = __toCommonJS(font_exports);
28
- var import_ts_pattern = require("ts-pattern");
29
- var import_prop_controllers = require("../prop-controllers");
30
- var import_zod = require("zod");
31
- const fontDataSchema = import_zod.z.string();
32
- const responsiveFontDataSchema = import_prop_controllers.Schema.responsiveValue(fontDataSchema);
33
- const fontPropControllerDataV0Schema = responsiveFontDataSchema;
34
- const FontPropControllerDataV1Type = "prop-controllers::font::v1";
35
- const fontPropControllerDataV1Schema = import_zod.z.object({
36
- [import_prop_controllers.ControlDataTypeKey]: import_zod.z.literal(FontPropControllerDataV1Type),
37
- value: responsiveFontDataSchema
38
- });
39
- const fontPropControllerDataSchema = import_zod.z.union([
40
- fontPropControllerDataV0Schema,
41
- fontPropControllerDataV1Schema
42
- ]);
43
- function Font(options = {}) {
44
- return { type: import_prop_controllers.Types.Font, version: 1, options };
45
- }
46
- function getFontPropControllerDataResponsiveFontData(data) {
47
- return (0, import_ts_pattern.match)(data).with(
48
- { [import_prop_controllers.ControlDataTypeKey]: FontPropControllerDataV1Type },
49
- (v1) => v1.value
50
- ).otherwise((v0) => v0);
51
- }
52
- function createFontPropControllerDataFromResponsiveFontData(responsiveFontData, definition) {
53
- return (0, import_ts_pattern.match)(definition).with(
54
- { version: 1 },
55
- import_ts_pattern.P.nullish,
56
- () => ({
57
- [import_prop_controllers.ControlDataTypeKey]: FontPropControllerDataV1Type,
58
- value: responsiveFontData
59
- })
60
- ).otherwise(() => responsiveFontData);
61
- }
62
- // Annotate the CommonJS export names for ESM import in node:
63
- 0 && (module.exports = {
64
- Font,
65
- FontPropControllerDataV1Type,
66
- createFontPropControllerDataFromResponsiveFontData,
67
- fontPropControllerDataSchema,
68
- getFontPropControllerDataResponsiveFontData
69
- });
70
- //# sourceMappingURL=font.js.map
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var font_exports = {};
17
- module.exports = __toCommonJS(font_exports);
18
- __reExport(font_exports, require("./font"), module.exports);
19
- // Annotate the CommonJS export names for ESM import in node:
20
- 0 && (module.exports = {
21
- ...require("./font")
22
- });
23
- //# sourceMappingURL=index.js.map
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var gap_x_exports = {};
20
- __export(gap_x_exports, {
21
- GapX: () => GapX
22
- });
23
- module.exports = __toCommonJS(gap_x_exports);
24
- var import_prop_controllers = require("../prop-controllers");
25
- var import_data = require("../data");
26
- var import_versioned = require("../versioned");
27
- const GapX = (0, import_versioned.versionedPropDef)(
28
- import_prop_controllers.Types.GapX,
29
- import_data.responsiveGapDataSchema,
30
- {
31
- version: 1,
32
- dataKey: "prop-controllers::gap-x::v1"
33
- },
34
- (0, import_versioned.typeArg)()
35
- );
36
- // Annotate the CommonJS export names for ESM import in node:
37
- 0 && (module.exports = {
38
- GapX
39
- });
40
- //# sourceMappingURL=gap-x.js.map
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var gap_x_exports = {};
17
- module.exports = __toCommonJS(gap_x_exports);
18
- __reExport(gap_x_exports, require("./gap-x"), module.exports);
19
- // Annotate the CommonJS export names for ESM import in node:
20
- 0 && (module.exports = {
21
- ...require("./gap-x")
22
- });
23
- //# sourceMappingURL=index.js.map
@@ -1,68 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var gap_y_exports = {};
20
- __export(gap_y_exports, {
21
- GapY: () => GapY,
22
- GapYPropControllerDataV1Type: () => GapYPropControllerDataV1Type,
23
- createGapYPropControllerDataFromResponsiveGapData: () => createGapYPropControllerDataFromResponsiveGapData,
24
- gapYPropControllerDataSchema: () => gapYPropControllerDataSchema,
25
- getGapYPropControllerDataResponsiveGapData: () => getGapYPropControllerDataResponsiveGapData
26
- });
27
- module.exports = __toCommonJS(gap_y_exports);
28
- var import_ts_pattern = require("ts-pattern");
29
- var import_prop_controllers = require("../prop-controllers");
30
- var import_zod = require("zod");
31
- var import_data = require("../data");
32
- const gapYPropControllerDataV0Schema = import_data.responsiveGapDataSchema;
33
- const GapYPropControllerDataV1Type = "prop-controllers::gap-y::v1";
34
- const gapYPropControllerDataV1Schema = import_zod.z.object({
35
- [import_prop_controllers.ControlDataTypeKey]: import_zod.z.literal(GapYPropControllerDataV1Type),
36
- value: import_data.responsiveGapDataSchema
37
- });
38
- const gapYPropControllerDataSchema = import_zod.z.union([
39
- gapYPropControllerDataV0Schema,
40
- gapYPropControllerDataV1Schema
41
- ]);
42
- function GapY(options = {}) {
43
- return { type: import_prop_controllers.Types.GapY, version: 1, options };
44
- }
45
- function getGapYPropControllerDataResponsiveGapData(data) {
46
- return (0, import_ts_pattern.match)(data).with(
47
- { [import_prop_controllers.ControlDataTypeKey]: GapYPropControllerDataV1Type },
48
- (v1) => v1.value
49
- ).otherwise((v0) => v0);
50
- }
51
- function createGapYPropControllerDataFromResponsiveGapData(responsiveGapData, definition) {
52
- return (0, import_ts_pattern.match)(definition).with(
53
- { version: 1 },
54
- () => ({
55
- [import_prop_controllers.ControlDataTypeKey]: GapYPropControllerDataV1Type,
56
- value: responsiveGapData
57
- })
58
- ).otherwise(() => responsiveGapData);
59
- }
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- GapY,
63
- GapYPropControllerDataV1Type,
64
- createGapYPropControllerDataFromResponsiveGapData,
65
- gapYPropControllerDataSchema,
66
- getGapYPropControllerDataResponsiveGapData
67
- });
68
- //# sourceMappingURL=gap-y.js.map
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var gap_y_exports = {};
17
- module.exports = __toCommonJS(gap_y_exports);
18
- __reExport(gap_y_exports, require("./gap-y"), module.exports);
19
- // Annotate the CommonJS export names for ESM import in node:
20
- 0 && (module.exports = {
21
- ...require("./gap-y")
22
- });
23
- //# sourceMappingURL=index.js.map
@@ -1,130 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var grid_exports = {};
20
- __export(grid_exports, {
21
- Grid: () => Grid,
22
- GridPropControllerDataV1Type: () => GridPropControllerDataV1Type,
23
- copyGridPropControllerData: () => copyGridPropControllerData,
24
- createGridPropControllerDataFromGridData: () => createGridPropControllerDataFromGridData,
25
- getGridPropControllerDataGridData: () => getGridPropControllerDataGridData,
26
- getGridPropControllerElementChildren: () => getGridPropControllerElementChildren,
27
- getGridPropControllerGetElementPath: () => getGridPropControllerGetElementPath,
28
- gridPropControllerDataSchema: () => gridPropControllerDataSchema,
29
- mergeGridPropControllerTranslatedData: () => mergeGridPropControllerTranslatedData
30
- });
31
- module.exports = __toCommonJS(grid_exports);
32
- var import_zod = require("zod");
33
- var import_prop_controllers = require("../prop-controllers");
34
- var import_ts_pattern = require("ts-pattern");
35
- const gridColumnSchema = import_zod.z.object({
36
- count: import_zod.z.number(),
37
- spans: import_zod.z.array(import_zod.z.array(import_zod.z.number()))
38
- });
39
- const gridDataSchema = import_zod.z.object({
40
- elements: import_zod.z.array(import_prop_controllers.Schema.element),
41
- columns: import_prop_controllers.Schema.responsiveValue(gridColumnSchema)
42
- });
43
- const gridPropControllerDataV0Schema = gridDataSchema;
44
- const GridPropControllerDataV1Type = "prop-controllers::grid::v1";
45
- const gridPropControllerDataV1Schema = import_zod.z.object({
46
- [import_prop_controllers.ControlDataTypeKey]: import_zod.z.literal(GridPropControllerDataV1Type),
47
- value: gridDataSchema
48
- });
49
- const gridPropControllerDataSchema = import_zod.z.union([
50
- gridPropControllerDataV0Schema,
51
- gridPropControllerDataV1Schema
52
- ]);
53
- function Grid(options = {}) {
54
- return { type: import_prop_controllers.Types.Grid, version: 1, options };
55
- }
56
- function getGridPropControllerDataGridData(data) {
57
- return (0, import_ts_pattern.match)(data).with(
58
- { [import_prop_controllers.ControlDataTypeKey]: GridPropControllerDataV1Type },
59
- (v1) => v1.value
60
- ).otherwise((v0) => v0);
61
- }
62
- function createGridPropControllerDataFromGridData(value, definition) {
63
- return (0, import_ts_pattern.match)(definition).with(
64
- { version: 1 },
65
- import_ts_pattern.P.nullish,
66
- () => ({
67
- [import_prop_controllers.ControlDataTypeKey]: GridPropControllerDataV1Type,
68
- value
69
- })
70
- ).otherwise(() => value);
71
- }
72
- function mergeGridDataTranslatedData(data, context) {
73
- return {
74
- ...data,
75
- elements: data.elements.map(
76
- (element) => context.mergeTranslatedData(element)
77
- )
78
- };
79
- }
80
- function mergeGridPropControllerTranslatedData(data, context) {
81
- return (0, import_ts_pattern.match)(data).with(
82
- { [import_prop_controllers.ControlDataTypeKey]: GridPropControllerDataV1Type },
83
- (v1) => ({
84
- [import_prop_controllers.ControlDataTypeKey]: GridPropControllerDataV1Type,
85
- value: mergeGridDataTranslatedData(v1.value, context)
86
- })
87
- ).otherwise((v0) => mergeGridDataTranslatedData(v0, context));
88
- }
89
- function getGridPropControllerElementChildren(data) {
90
- return getGridPropControllerDataGridData(data)?.elements ?? [];
91
- }
92
- function copyGridData(data, context) {
93
- return {
94
- ...data,
95
- elements: data.elements.map((element) => context.copyElement(element))
96
- };
97
- }
98
- function copyGridPropControllerData(data, context) {
99
- return (0, import_ts_pattern.match)(data).with(void 0, () => void 0).with(
100
- { [import_prop_controllers.ControlDataTypeKey]: GridPropControllerDataV1Type },
101
- (v1) => ({
102
- [import_prop_controllers.ControlDataTypeKey]: GridPropControllerDataV1Type,
103
- value: copyGridData(v1.value, context)
104
- })
105
- ).otherwise((v0) => copyGridData(v0, context));
106
- }
107
- function getGridPropControllerGetElementPath(data, elementKey) {
108
- const value = getGridPropControllerDataGridData(data);
109
- const idx = value?.elements.findIndex((element) => element.key === elementKey) ?? -1;
110
- if (idx === -1)
111
- return null;
112
- return (0, import_ts_pattern.match)(data).with({ [import_prop_controllers.ControlDataTypeKey]: GridPropControllerDataV1Type }, (_v1) => [
113
- "value",
114
- "elements",
115
- idx
116
- ]).otherwise((_v0) => ["elements", idx]);
117
- }
118
- // Annotate the CommonJS export names for ESM import in node:
119
- 0 && (module.exports = {
120
- Grid,
121
- GridPropControllerDataV1Type,
122
- copyGridPropControllerData,
123
- createGridPropControllerDataFromGridData,
124
- getGridPropControllerDataGridData,
125
- getGridPropControllerElementChildren,
126
- getGridPropControllerGetElementPath,
127
- gridPropControllerDataSchema,
128
- mergeGridPropControllerTranslatedData
129
- });
130
- //# sourceMappingURL=grid.js.map