@makeswift/runtime 0.8.4 → 0.8.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.
Files changed (196) hide show
  1. package/dist/Box.cjs.js +11 -11
  2. package/dist/Box.cjs.js.map +1 -1
  3. package/dist/Box.es.js +9 -9
  4. package/dist/Box.es.js.map +1 -1
  5. package/dist/Button.cjs.js +36 -37
  6. package/dist/Button.cjs.js.map +1 -1
  7. package/dist/Button.es.js +13 -14
  8. package/dist/Button.es.js.map +1 -1
  9. package/dist/Carousel.cjs.js +38 -37
  10. package/dist/Carousel.cjs.js.map +1 -1
  11. package/dist/Carousel.es.js +19 -18
  12. package/dist/Carousel.es.js.map +1 -1
  13. package/dist/Countdown.cjs.js +55 -29
  14. package/dist/Countdown.cjs.js.map +1 -1
  15. package/dist/Countdown.es.js +35 -9
  16. package/dist/Countdown.es.js.map +1 -1
  17. package/dist/Divider.cjs.js +36 -10
  18. package/dist/Divider.cjs.js.map +1 -1
  19. package/dist/Divider.es.js +31 -5
  20. package/dist/Divider.es.js.map +1 -1
  21. package/dist/Embed.cjs.js +31 -5
  22. package/dist/Embed.cjs.js.map +1 -1
  23. package/dist/Embed.es.js +30 -4
  24. package/dist/Embed.es.js.map +1 -1
  25. package/dist/Form.cjs.js +72 -73
  26. package/dist/Form.cjs.js.map +1 -1
  27. package/dist/Form.es.js +32 -33
  28. package/dist/Form.es.js.map +1 -1
  29. package/dist/Image.cjs.js +22 -21
  30. package/dist/Image.cjs.js.map +1 -1
  31. package/dist/Image.es.js +20 -19
  32. package/dist/Image.es.js.map +1 -1
  33. package/dist/LiveProvider.cjs.js +8 -9
  34. package/dist/LiveProvider.cjs.js.map +1 -1
  35. package/dist/LiveProvider.es.js +8 -9
  36. package/dist/LiveProvider.es.js.map +1 -1
  37. package/dist/Navigation.cjs.js +33 -34
  38. package/dist/Navigation.cjs.js.map +1 -1
  39. package/dist/Navigation.es.js +14 -15
  40. package/dist/Navigation.es.js.map +1 -1
  41. package/dist/PreviewProvider.cjs.js +12 -10
  42. package/dist/PreviewProvider.cjs.js.map +1 -1
  43. package/dist/PreviewProvider.es.js +12 -10
  44. package/dist/PreviewProvider.es.js.map +1 -1
  45. package/dist/ReadOnlyText.cjs.js +15 -16
  46. package/dist/ReadOnlyText.cjs.js.map +1 -1
  47. package/dist/ReadOnlyText.es.js +11 -12
  48. package/dist/ReadOnlyText.es.js.map +1 -1
  49. package/dist/Root.cjs.js +10 -10
  50. package/dist/Root.cjs.js.map +1 -1
  51. package/dist/Root.es.js +8 -8
  52. package/dist/SocialLinks.cjs.js +12 -13
  53. package/dist/SocialLinks.cjs.js.map +1 -1
  54. package/dist/SocialLinks.es.js +7 -8
  55. package/dist/SocialLinks.es.js.map +1 -1
  56. package/dist/Text.cjs.js +3 -4
  57. package/dist/Text.cjs.js.map +1 -1
  58. package/dist/Text.es.js +4 -5
  59. package/dist/Text.es.js.map +1 -1
  60. package/dist/Video.cjs.js +31 -5
  61. package/dist/Video.cjs.js.map +1 -1
  62. package/dist/Video.es.js +30 -4
  63. package/dist/Video.es.js.map +1 -1
  64. package/dist/actions.cjs.js +6 -1
  65. package/dist/actions.cjs.js.map +1 -1
  66. package/dist/actions.es.js +6 -2
  67. package/dist/actions.es.js.map +1 -1
  68. package/dist/components.cjs.js +10 -10
  69. package/dist/components.es.js +10 -10
  70. package/dist/constants.cjs.js +7 -1
  71. package/dist/constants.cjs.js.map +1 -1
  72. package/dist/constants.es.js +7 -2
  73. package/dist/constants.es.js.map +1 -1
  74. package/dist/descriptors.cjs.js.map +1 -1
  75. package/dist/descriptors.es.js.map +1 -1
  76. package/dist/index.cjs.js +934 -120
  77. package/dist/index.cjs.js.map +1 -1
  78. package/dist/index.cjs2.js +29 -29
  79. package/dist/index.cjs2.js.map +1 -1
  80. package/dist/index.cjs3.js +1 -2
  81. package/dist/index.cjs3.js.map +1 -1
  82. package/dist/index.cjs4.js +2 -2
  83. package/dist/index.cjs4.js.map +1 -1
  84. package/dist/index.cjs5.js +6 -7
  85. package/dist/index.cjs5.js.map +1 -1
  86. package/dist/index.cjs6.js +3 -4
  87. package/dist/index.cjs6.js.map +1 -1
  88. package/dist/index.cjs7.js +29 -23
  89. package/dist/index.cjs7.js.map +1 -1
  90. package/dist/index.es.js +890 -92
  91. package/dist/index.es.js.map +1 -1
  92. package/dist/index.es2.js +6 -6
  93. package/dist/index.es2.js.map +1 -1
  94. package/dist/index.es3.js +1 -2
  95. package/dist/index.es3.js.map +1 -1
  96. package/dist/index.es4.js +2 -2
  97. package/dist/index.es4.js.map +1 -1
  98. package/dist/index.es5.js +6 -7
  99. package/dist/index.es5.js.map +1 -1
  100. package/dist/index.es6.js +3 -4
  101. package/dist/index.es6.js.map +1 -1
  102. package/dist/index.es7.js +25 -19
  103. package/dist/index.es7.js.map +1 -1
  104. package/dist/introspection.cjs.js +5 -2
  105. package/dist/introspection.cjs.js.map +1 -1
  106. package/dist/introspection.es.js +4 -2
  107. package/dist/introspection.es.js.map +1 -1
  108. package/dist/leaf.cjs.js +15 -17
  109. package/dist/leaf.cjs.js.map +1 -1
  110. package/dist/leaf.es.js +10 -11
  111. package/dist/leaf.es.js.map +1 -1
  112. package/dist/main.cjs.js +2 -1
  113. package/dist/main.cjs.js.map +1 -1
  114. package/dist/main.es.js +2 -2
  115. package/dist/next.cjs.js +5 -6
  116. package/dist/next.cjs.js.map +1 -1
  117. package/dist/next.es.js +6 -7
  118. package/dist/next.es.js.map +1 -1
  119. package/dist/prop-controllers.cjs.js +0 -1
  120. package/dist/prop-controllers.cjs.js.map +1 -1
  121. package/dist/prop-controllers.es.js +0 -1
  122. package/dist/prop-controllers.es.js.map +1 -1
  123. package/dist/react.cjs.js +3 -4
  124. package/dist/react.cjs.js.map +1 -1
  125. package/dist/react.es.js +3 -4
  126. package/dist/react.es.js.map +1 -1
  127. package/dist/slate.cjs.js +1 -12
  128. package/dist/slate.cjs.js.map +1 -1
  129. package/dist/slate.es.js +1 -12
  130. package/dist/slate.es.js.map +1 -1
  131. package/dist/state/breakpoints.cjs.js +175 -0
  132. package/dist/state/breakpoints.cjs.js.map +1 -0
  133. package/dist/state/breakpoints.es.js +160 -0
  134. package/dist/state/breakpoints.es.js.map +1 -0
  135. package/dist/types/src/components/builtin/Box/Box.d.ts.map +1 -1
  136. package/dist/types/src/components/builtin/Box/register.d.ts.map +1 -1
  137. package/dist/types/src/components/builtin/Button/Button.d.ts.map +1 -1
  138. package/dist/types/src/components/builtin/Button/register.d.ts.map +1 -1
  139. package/dist/types/src/components/builtin/Carousel/Carousel.d.ts.map +1 -1
  140. package/dist/types/src/components/builtin/Carousel/register.d.ts.map +1 -1
  141. package/dist/types/src/components/builtin/Countdown/register.d.ts.map +1 -1
  142. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
  143. package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts.map +1 -1
  144. package/dist/types/src/components/builtin/Form/register.d.ts.map +1 -1
  145. package/dist/types/src/components/builtin/Image/Image.d.ts.map +1 -1
  146. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -1
  147. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
  148. package/dist/types/src/components/builtin/Navigation/register.d.ts.map +1 -1
  149. package/dist/types/src/components/builtin/SocialLinks/register.d.ts.map +1 -1
  150. package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts.map +1 -1
  151. package/dist/types/src/components/builtin/Text/EditableText/useSyncDOMSelection.d.ts +1 -1
  152. package/dist/types/src/components/builtin/Text/EditableText/useSyncDOMSelection.d.ts.map +1 -1
  153. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +0 -4
  154. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
  155. package/dist/types/src/components/builtin/Text/register.d.ts.map +1 -1
  156. package/dist/types/src/components/hooks/useMediaQuery.d.ts.map +1 -1
  157. package/dist/types/src/components/utils/drop-first.d.ts +2 -0
  158. package/dist/types/src/components/utils/drop-first.d.ts.map +1 -0
  159. package/dist/types/src/components/utils/responsive-style.d.ts +21 -10
  160. package/dist/types/src/components/utils/responsive-style.d.ts.map +1 -1
  161. package/dist/types/src/controls/types.d.ts +1 -1
  162. package/dist/types/src/controls/types.d.ts.map +1 -1
  163. package/dist/types/src/index.d.ts +2 -2
  164. package/dist/types/src/index.d.ts.map +1 -1
  165. package/dist/types/src/prop-controllers/descriptors.d.ts +1 -1
  166. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  167. package/dist/types/src/runtimes/react/index.d.ts +4 -0
  168. package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
  169. package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts +2 -1
  170. package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts.map +1 -1
  171. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts +2 -1
  172. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts.map +1 -1
  173. package/dist/types/src/state/actions.d.ts +10 -1
  174. package/dist/types/src/state/actions.d.ts.map +1 -1
  175. package/dist/types/src/state/modules/breakpoints.d.ts +44 -0
  176. package/dist/types/src/state/modules/breakpoints.d.ts.map +1 -0
  177. package/dist/types/src/state/react-builder-preview.d.ts +2 -0
  178. package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
  179. package/dist/types/src/state/react-page.d.ts +3 -0
  180. package/dist/types/src/state/react-page.d.ts.map +1 -1
  181. package/dist/useMediaQuery.cjs.js +38 -0
  182. package/dist/useMediaQuery.cjs.js.map +1 -0
  183. package/dist/useMediaQuery.es.js +37 -0
  184. package/dist/useMediaQuery.es.js.map +1 -0
  185. package/package.json +10 -2
  186. package/state/breakpoints.js +1 -0
  187. package/dist/isNonNullable.cjs.js +0 -6
  188. package/dist/isNonNullable.cjs.js.map +0 -1
  189. package/dist/isNonNullable.es.js +0 -5
  190. package/dist/isNonNullable.es.js.map +0 -1
  191. package/dist/responsive-style.cjs.js +0 -917
  192. package/dist/responsive-style.cjs.js.map +0 -1
  193. package/dist/responsive-style.es.js +0 -853
  194. package/dist/responsive-style.es.js.map +0 -1
  195. package/dist/types/src/components/utils/devices.d.ts +0 -17
  196. package/dist/types/src/components/utils/devices.d.ts.map +0 -1
@@ -1,917 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
- var __publicField = (obj, key, value) => {
22
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
23
- return value;
24
- };
25
- var _a;
26
- var React = require("react");
27
- var css = require("@emotion/css");
28
- var serialize = require("@emotion/serialize");
29
- var utils = require("@emotion/utils");
30
- var shim = require("use-sync-external-store/shim");
31
- var redux = require("redux");
32
- var thunk = require("redux-thunk");
33
- var types = require("./types.cjs.js");
34
- var actions = require("./actions.cjs.js");
35
- var jsxRuntime = require("react/jsx-runtime");
36
- function _interopDefaultLegacy(e) {
37
- return e && typeof e === "object" && "default" in e ? e : { "default": e };
38
- }
39
- function _interopNamespace(e) {
40
- if (e && e.__esModule)
41
- return e;
42
- var n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
43
- if (e) {
44
- Object.keys(e).forEach(function(k) {
45
- if (k !== "default") {
46
- var d = Object.getOwnPropertyDescriptor(e, k);
47
- Object.defineProperty(n, k, d.get ? d : {
48
- enumerable: true,
49
- get: function() {
50
- return e[k];
51
- }
52
- });
53
- }
54
- });
55
- }
56
- n["default"] = e;
57
- return Object.freeze(n);
58
- }
59
- var React__namespace = /* @__PURE__ */ _interopNamespace(React);
60
- var thunk__default = /* @__PURE__ */ _interopDefaultLegacy(thunk);
61
- function is(x, y) {
62
- if (x === y)
63
- return x !== 0 || y !== 0 || 1 / x === 1 / y;
64
- return x !== x && y !== y;
65
- }
66
- const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
67
- const shallowEqual = (a, b) => {
68
- if (is(a, b))
69
- return true;
70
- if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
71
- return false;
72
- const keysA = Object.keys(a);
73
- const keysB = Object.keys(b);
74
- if (keysA.length !== keysB.length)
75
- return false;
76
- for (let i = 0; i < keysA.length; i += 1) {
77
- if (!hasOwnProperty$1.call(b, keysA[i]) || !is(a[keysA[i]], b[keysA[i]]))
78
- return false;
79
- }
80
- return true;
81
- };
82
- const { hasOwnProperty } = Object.prototype;
83
- const deepEqual = (a, b) => {
84
- if (shallowEqual(a, b))
85
- return true;
86
- if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
87
- return false;
88
- const keysA = Object.keys(a);
89
- const keysB = Object.keys(b);
90
- if (keysA.length !== keysB.length)
91
- return false;
92
- for (let i = 0; i < keysA.length; i += 1) {
93
- if (!hasOwnProperty.call(b, keysA[i]) || !deepEqual(a[keysA[i]], b[keysA[i]]))
94
- return false;
95
- }
96
- return true;
97
- };
98
- function getInitialState(serializedState = {
99
- Swatch: [],
100
- File: [],
101
- Typography: [],
102
- PagePathnameSlice: [],
103
- GlobalElement: [],
104
- Table: [],
105
- Snippet: [],
106
- Page: [],
107
- Site: []
108
- }) {
109
- return new Map(Object.entries(serializedState).map(([apiResourceType, resources]) => [
110
- apiResourceType,
111
- new Map(resources.map(({ id, value }) => [id, value]))
112
- ]));
113
- }
114
- function getHasAPIResource$1(state, resourceType, resourceId) {
115
- var _a2, _b;
116
- return (_b = (_a2 = state.get(resourceType)) == null ? void 0 : _a2.has(resourceId)) != null ? _b : false;
117
- }
118
- function getAPIResource$1(state, resourceType, resourceId) {
119
- var _a2;
120
- const resource = (_a2 = state.get(resourceType)) == null ? void 0 : _a2.get(resourceId);
121
- return (resource == null ? void 0 : resource.__typename) === resourceType ? resource : null;
122
- }
123
- function reducer$1(state = getInitialState(), action) {
124
- switch (action.type) {
125
- case actions.ActionTypes.API_RESOURCE_FULFILLED: {
126
- const { resourceType, resourceId, resource } = action.payload;
127
- return new Map(state).set(resourceType, new Map(state.get(resourceType)).set(resourceId, resource));
128
- }
129
- case actions.ActionTypes.CHANGE_API_RESOURCE: {
130
- const existingApiResource = getAPIResource$1(state, action.payload.resource.__typename, action.payload.resource.id);
131
- if (deepEqual(existingApiResource, action.payload.resource))
132
- return state;
133
- return new Map(state).set(action.payload.resource.__typename, new Map(state.get(action.payload.resource.__typename)).set(action.payload.resource.id, action.payload.resource));
134
- }
135
- case actions.ActionTypes.EVICT_API_RESOURCE: {
136
- const [resourceType, resourceId] = action.payload.id.split(":");
137
- if (!(resourceType in types.APIResourceType))
138
- return state;
139
- const resources = new Map(state.get(resourceType));
140
- const deleted = resources.delete(resourceId);
141
- return deleted ? new Map(state).set(resourceType, resources) : state;
142
- }
143
- default:
144
- return state;
145
- }
146
- }
147
- const reducer = reducer$1;
148
- function getHasAPIResource(state, resourceType, resourceId) {
149
- return getHasAPIResource$1(state, resourceType, resourceId);
150
- }
151
- function getAPIResource(state, resourceType, resourceId) {
152
- return getAPIResource$1(state, resourceType, resourceId);
153
- }
154
- async function fetchJson(url) {
155
- var _a2;
156
- const response = await fetch(url, {
157
- headers: { "Content-Type": "application/json" }
158
- });
159
- if (response.status === 404)
160
- return null;
161
- if (!response.ok)
162
- throw new Error(response.statusText);
163
- if (((_a2 = response.headers.get("content-type")) == null ? void 0 : _a2.includes("application/json")) !== true) {
164
- throw new Error(`Expected JSON response from "${url}" but got "${response.headers.get("content-type")}"`);
165
- }
166
- return response.json();
167
- }
168
- function fetchAPIResource(resourceType, resourceId) {
169
- return async (dispatch, getState) => {
170
- const state = getState();
171
- if (getHasAPIResource(state, resourceType, resourceId)) {
172
- return getAPIResource(state, resourceType, resourceId);
173
- }
174
- let resource;
175
- switch (resourceType) {
176
- case types.APIResourceType.Swatch:
177
- resource = await fetchJson(`/api/makeswift/swatches/${resourceId}`);
178
- break;
179
- case types.APIResourceType.File:
180
- resource = await fetchJson(`/api/makeswift/files/${resourceId}`);
181
- break;
182
- case types.APIResourceType.Typography:
183
- resource = await fetchJson(`/api/makeswift/typographies/${resourceId}`);
184
- break;
185
- case types.APIResourceType.GlobalElement:
186
- resource = await fetchJson(`/api/makeswift/global-elements/${resourceId}`);
187
- break;
188
- case types.APIResourceType.PagePathnameSlice:
189
- resource = await fetchJson(`/api/makeswift/page-pathname-slices/${resourceId}`);
190
- break;
191
- case types.APIResourceType.Table:
192
- resource = await fetchJson(`/api/makeswift/tables/${resourceId}`);
193
- break;
194
- default:
195
- resource = null;
196
- }
197
- dispatch(actions.apiResourceFulfilled(resourceType, resourceId, resource));
198
- return resource;
199
- };
200
- }
201
- function configureStore({ serializedState }) {
202
- return redux.createStore(reducer, getInitialState(serializedState), redux.applyMiddleware(thunk__default["default"]));
203
- }
204
- class GraphQLClient {
205
- constructor(endpoint) {
206
- __publicField(this, "endpoint");
207
- this.endpoint = endpoint;
208
- }
209
- async request(query, variables = {}) {
210
- const response = await fetch(this.endpoint, {
211
- method: "POST",
212
- headers: { "Content-Type": "application/json" },
213
- body: JSON.stringify({ query, variables })
214
- });
215
- if (!response.ok && response.status !== 400) {
216
- throw new Error(`${response.status} ${response.statusText}`);
217
- }
218
- const body = await response.json();
219
- if (body.errors != null) {
220
- console.error(body);
221
- throw new Error("GraphQL response contains errors, check the console.");
222
- }
223
- return body.data;
224
- }
225
- }
226
- const SwatchFragment = `
227
- fragment Swatch on Swatch {
228
- __typename
229
- id
230
- hue
231
- saturation
232
- lightness
233
- }
234
- `;
235
- const FileFragment = `
236
- fragment File on File {
237
- __typename
238
- id
239
- name
240
- publicUrl: publicUrlV2
241
- extension
242
- dimensions {
243
- width
244
- height
245
- }
246
- }
247
- `;
248
- const TypographyFragment = `
249
- fragment Typography on Typography {
250
- __typename
251
- id
252
- name
253
- style {
254
- deviceId
255
- value {
256
- fontFamily
257
- fontSize {
258
- value
259
- unit
260
- }
261
- color {
262
- swatchId
263
- alpha
264
- }
265
- lineHeight
266
- letterSpacing
267
- fontWeight
268
- textAlign
269
- uppercase
270
- underline
271
- strikethrough
272
- italic
273
- }
274
- }
275
- }
276
- `;
277
- const PagePathnameSliceFragment = `
278
- fragment PagePathnameSlice on PagePathnameSlice {
279
- __typename
280
- id
281
- pathname
282
- }
283
- `;
284
- const GlobalElementFragment = `
285
- fragment GlobalElement on GlobalElement {
286
- __typename
287
- id
288
- data
289
- }
290
- `;
291
- const TableFragment = `
292
- fragment Table on Table {
293
- __typename
294
- id
295
- name
296
- columns {
297
- __typename
298
- id
299
- name
300
-
301
- ... on MultipleSelectTableColumn {
302
- options {
303
- id
304
- name
305
- }
306
- }
307
-
308
- ... on SingleSelectTableColumn {
309
- options {
310
- id
311
- name
312
- }
313
- }
314
- }
315
- }
316
- `;
317
- const IntrospectedResourcesQuery = `
318
- query IntrospectedResources(
319
- $swatchIds: [ID!]!
320
- $fileIds: [ID!]!
321
- $pageIds: [ID!]!
322
- $tableIds: [ID!]!
323
- ) {
324
- swatches(ids: $swatchIds) {
325
- ...Swatch
326
- }
327
-
328
- files(ids: $fileIds) {
329
- ...File
330
- }
331
-
332
- pagePathnamesById(ids: $pageIds) {
333
- ...PagePathnameSlice
334
- }
335
-
336
- tables(ids: $tableIds) {
337
- ...Table
338
- }
339
- }
340
-
341
- ${SwatchFragment}
342
- ${FileFragment}
343
- ${PagePathnameSliceFragment}
344
- ${TableFragment}
345
- `;
346
- const SwatchQuery = `
347
- query Swatch($swatchId: ID!) {
348
- swatch(id: $swatchId) {
349
- ...Swatch
350
- }
351
- }
352
-
353
- ${SwatchFragment}
354
- `;
355
- const FileQuery = `
356
- query File($fileId: ID!) {
357
- file(id: $fileId) {
358
- ...File
359
- }
360
- }
361
-
362
- ${FileFragment}
363
- `;
364
- const TypographyQuery = `
365
- query Typography($typographyId: ID!) {
366
- typography(id: $typographyId) {
367
- ...Typography
368
- }
369
- }
370
-
371
- ${TypographyFragment}
372
- `;
373
- const PagePathnamesByIdQuery = `
374
- query PagePathnamesById($pageIds: [ID!]!) {
375
- pagePathnamesById(ids: $pageIds) {
376
- ...PagePathnameSlice
377
- }
378
- }
379
-
380
- ${PagePathnameSliceFragment}
381
- `;
382
- const TableQuery = `
383
- query Table($tableId: ID!) {
384
- table(id: $tableId) {
385
- ...Table
386
- }
387
- }
388
-
389
- ${TableFragment}
390
- `;
391
- const TypographiesQuery = `
392
- query Typographies($typographyIds: [ID!]!) {
393
- typographies(ids: $typographyIds) {
394
- ...Typography
395
- }
396
- }
397
-
398
- ${TypographyFragment}
399
- `;
400
- const GlobalElementQuery = `
401
- query GlobalElement($globalElementId: ID!) {
402
- globalElement(id: $globalElementId) {
403
- ...GlobalElement
404
- }
405
- }
406
-
407
- ${GlobalElementFragment}
408
- `;
409
- const CreateTableRecordMutation = `
410
- mutation CreateTableRecord($input: CreateTableRecordInput!) {
411
- createTableRecord(input: $input) {
412
- tableRecord {
413
- id
414
- }
415
- }
416
- }
417
- `;
418
- class MakeswiftClient {
419
- constructor({
420
- uri,
421
- cacheData
422
- }) {
423
- __publicField(this, "graphqlClient");
424
- __publicField(this, "makeswiftApiClient");
425
- __publicField(this, "subscribe");
426
- this.graphqlClient = new GraphQLClient(uri);
427
- this.makeswiftApiClient = configureStore({
428
- serializedState: cacheData
429
- });
430
- this.subscribe = this.makeswiftApiClient.subscribe;
431
- }
432
- readSwatch(swatchId) {
433
- return getAPIResource(this.makeswiftApiClient.getState(), types.APIResourceType.Swatch, swatchId);
434
- }
435
- async fetchSwatch(swatchId) {
436
- return await this.makeswiftApiClient.dispatch(fetchAPIResource(types.APIResourceType.Swatch, swatchId));
437
- }
438
- readFile(fileId) {
439
- return getAPIResource(this.makeswiftApiClient.getState(), types.APIResourceType.File, fileId);
440
- }
441
- async fetchFile(fileId) {
442
- return await this.makeswiftApiClient.dispatch(fetchAPIResource(types.APIResourceType.File, fileId));
443
- }
444
- readTypography(typographyId) {
445
- return getAPIResource(this.makeswiftApiClient.getState(), types.APIResourceType.Typography, typographyId);
446
- }
447
- async fetchTypography(typographyId) {
448
- return await this.makeswiftApiClient.dispatch(fetchAPIResource(types.APIResourceType.Typography, typographyId));
449
- }
450
- readGlobalElement(globalElementId) {
451
- return getAPIResource(this.makeswiftApiClient.getState(), types.APIResourceType.GlobalElement, globalElementId);
452
- }
453
- async fetchGlobalElement(globalElementId) {
454
- return await this.makeswiftApiClient.dispatch(fetchAPIResource(types.APIResourceType.GlobalElement, globalElementId));
455
- }
456
- readPagePathnameSlice(pageId) {
457
- return getAPIResource(this.makeswiftApiClient.getState(), types.APIResourceType.PagePathnameSlice, pageId);
458
- }
459
- async fetchPagePathnameSlice(pageId) {
460
- return await this.makeswiftApiClient.dispatch(fetchAPIResource(types.APIResourceType.PagePathnameSlice, pageId));
461
- }
462
- readTable(tableId) {
463
- return getAPIResource(this.makeswiftApiClient.getState(), types.APIResourceType.Table, tableId);
464
- }
465
- async fetchTable(tableId) {
466
- return await this.makeswiftApiClient.dispatch(fetchAPIResource(types.APIResourceType.Table, tableId));
467
- }
468
- async createTableRecord(tableId, columns) {
469
- await this.graphqlClient.request(CreateTableRecordMutation, {
470
- input: {
471
- data: {
472
- tableId,
473
- columns
474
- }
475
- }
476
- });
477
- }
478
- readSite(siteId) {
479
- return getAPIResource(this.makeswiftApiClient.getState(), types.APIResourceType.Site, siteId);
480
- }
481
- readPage(pageId) {
482
- return getAPIResource(this.makeswiftApiClient.getState(), types.APIResourceType.Page, pageId);
483
- }
484
- readSnippet(snippetId) {
485
- return getAPIResource(this.makeswiftApiClient.getState(), types.APIResourceType.Snippet, snippetId);
486
- }
487
- }
488
- const Context = React.createContext(new MakeswiftClient({
489
- uri: "https://api.makeswift.com/graphql"
490
- }));
491
- function useMakeswiftClient() {
492
- return React.useContext(Context);
493
- }
494
- function MakeswiftProvider({
495
- client,
496
- children
497
- }) {
498
- return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, {
499
- value: client,
500
- children
501
- });
502
- }
503
- const keys = (o) => Object.keys(o);
504
- const coalesce = (...args) => {
505
- let i;
506
- for (i = 0; i < args.length - 1; i += 1) {
507
- if (args[i] != null)
508
- return args[i];
509
- }
510
- return args[i];
511
- };
512
- function shallowMerge(a, b) {
513
- const bKeys = keys(b);
514
- const merged = __spreadValues({}, a);
515
- bKeys.forEach((key) => {
516
- merged[key] = coalesce(merged[key], b[key]);
517
- });
518
- return merged;
519
- }
520
- const DEVICES = [
521
- { id: "desktop", minWidth: 769 },
522
- { id: "tablet", minWidth: 576, maxWidth: 768 },
523
- { id: "mobile", maxWidth: 575 }
524
- ];
525
- const getDevice = (deviceId) => {
526
- const device = DEVICES.find(({ id }) => id === deviceId);
527
- if (device == null)
528
- throw new Error(`Unrecognized device ID: "${deviceId}".`);
529
- return device;
530
- };
531
- function defaultStrategy(value, fallbacks) {
532
- return value || fallbacks[0];
533
- }
534
- function shallowMergeFallbacks(value, fallbacks) {
535
- return [value, ...fallbacks].filter((override) => Boolean(override)).reduce((a, b) => ({
536
- deviceId: a.deviceId || b.deviceId,
537
- value: shallowMerge(a.value, b.value)
538
- }));
539
- }
540
- function findDeviceOverride(values = [], deviceId, strategy = defaultStrategy) {
541
- const value = values.find(({ deviceId: d }) => d === deviceId);
542
- const fallbacks = DEVICES.slice(0, DEVICES.findIndex((d) => d.id === deviceId) + 1).reverse().map((d) => values.find((v) => v.deviceId === d.id)).filter((override) => Boolean(override));
543
- return value != null || fallbacks.length > 0 ? strategy(value, fallbacks) : void 0;
544
- }
545
- function join(responsiveValues, joinFn, strategy) {
546
- return DEVICES.map(({ id }) => id).map((deviceId) => {
547
- const value = joinFn(responsiveValues.map((responsiveValue) => {
548
- const deviceValue = responsiveValue && findDeviceOverride(responsiveValue, deviceId, strategy);
549
- return deviceValue == null ? void 0 : deviceValue.value;
550
- }));
551
- if (value == null)
552
- return null;
553
- return { deviceId, value };
554
- }).filter((override) => Boolean(override));
555
- }
556
- const getDeviceMediaQuery = (device) => {
557
- const parts = ["@media only screen"];
558
- if (device.minWidth != null) {
559
- parts.push(`(min-width: ${device.minWidth}px)`);
560
- }
561
- if (device.maxWidth != null) {
562
- parts.push(`(max-width: ${device.maxWidth}px)`);
563
- }
564
- return parts.join(" and ");
565
- };
566
- const isServer = typeof window === "undefined";
567
- const useInsertionEffectSpecifier = "useInsertionEffect";
568
- const useInsertionEffect = (_a = React__namespace[useInsertionEffectSpecifier]) != null ? _a : React__namespace.useLayoutEffect;
569
- function useStyle(style) {
570
- const serialized = serialize.serializeStyles([style], css.cache.registered);
571
- utils.registerStyles(css.cache, serialized, false);
572
- useInsertionEffect(() => {
573
- utils.insertStyles(css.cache, serialized, false);
574
- });
575
- if (isServer)
576
- utils.insertStyles(css.cache, serialized, false);
577
- return `${css.cache.key}-${serialized.name}`;
578
- }
579
- function useSwatch(swatchId) {
580
- const client = useMakeswiftClient();
581
- const readSwatch = () => swatchId == null ? null : client.readSwatch(swatchId);
582
- const swatch = shim.useSyncExternalStore(client.subscribe, readSwatch, readSwatch);
583
- React.useEffect(() => {
584
- if (swatchId != null)
585
- client.fetchSwatch(swatchId).catch(console.error);
586
- }, [client, swatchId]);
587
- return swatch;
588
- }
589
- function useSwatches(swatchIds) {
590
- const client = useMakeswiftClient();
591
- const lastSnapshot = React.useRef();
592
- function getSnapshot() {
593
- const swatches2 = swatchIds.map((swatchId) => client.readSwatch(swatchId));
594
- if (lastSnapshot.current != null && lastSnapshot.current.length === swatches2.length && lastSnapshot.current.every((swatch, idx) => swatches2[idx] === swatch)) {
595
- return lastSnapshot.current;
596
- }
597
- return lastSnapshot.current = swatches2;
598
- }
599
- const swatches = shim.useSyncExternalStore(client.subscribe, getSnapshot, getSnapshot);
600
- React.useEffect(() => {
601
- Promise.all(swatchIds.map((swatchId) => client.fetchSwatch(swatchId))).catch(console.error);
602
- }, [client, swatchIds]);
603
- return swatches;
604
- }
605
- function useFile(fileId) {
606
- const client = useMakeswiftClient();
607
- const readFile = () => fileId == null ? null : client.readFile(fileId);
608
- const file = shim.useSyncExternalStore(client.subscribe, readFile, readFile);
609
- React.useEffect(() => {
610
- if (fileId != null)
611
- client.fetchFile(fileId);
612
- }, [client, fileId]);
613
- return file;
614
- }
615
- function useFiles(fileIds) {
616
- const client = useMakeswiftClient();
617
- const lastSnapshot = React.useRef();
618
- function getSnapshot() {
619
- const files2 = fileIds.map((fileId) => client.readFile(fileId));
620
- if (lastSnapshot.current != null && lastSnapshot.current.length === files2.length && lastSnapshot.current.every((file, idx) => files2[idx] === file)) {
621
- return lastSnapshot.current;
622
- }
623
- return lastSnapshot.current = files2;
624
- }
625
- const files = shim.useSyncExternalStore(client.subscribe, getSnapshot, getSnapshot);
626
- React.useEffect(() => {
627
- Promise.all(fileIds.map((fileId) => client.fetchFile(fileId))).catch(console.error);
628
- }, [client, fileIds]);
629
- return files;
630
- }
631
- function useTypography(typographyId) {
632
- const client = useMakeswiftClient();
633
- const readTypography = () => typographyId == null ? null : client.readTypography(typographyId);
634
- const typography = shim.useSyncExternalStore(client.subscribe, readTypography, readTypography);
635
- React.useEffect(() => {
636
- if (typographyId != null)
637
- client.fetchTypography(typographyId).catch(console.error);
638
- }, [client, typographyId]);
639
- return typography;
640
- }
641
- function useGlobalElement(globalElementId) {
642
- const client = useMakeswiftClient();
643
- const readGlobalElement = () => globalElementId == null ? null : client.readGlobalElement(globalElementId);
644
- const globalElement = shim.useSyncExternalStore(client.subscribe, readGlobalElement, readGlobalElement);
645
- React.useEffect(() => {
646
- if (globalElementId != null)
647
- client.fetchGlobalElement(globalElementId).catch(console.error);
648
- }, [client, globalElementId]);
649
- return globalElement;
650
- }
651
- function usePagePathnameSlice(pageId) {
652
- const client = useMakeswiftClient();
653
- const readPagePathnameSlice = () => pageId == null ? null : client.readPagePathnameSlice(pageId);
654
- const pagePathnameSlice = shim.useSyncExternalStore(client.subscribe, readPagePathnameSlice, readPagePathnameSlice);
655
- React.useEffect(() => {
656
- if (pageId != null)
657
- client.fetchPagePathnameSlice(pageId).catch(console.error);
658
- }, [client, pageId]);
659
- return pagePathnameSlice;
660
- }
661
- function useTable(tableId) {
662
- const client = useMakeswiftClient();
663
- const readTable = () => tableId == null ? null : client.readTable(tableId);
664
- const table = shim.useSyncExternalStore(client.subscribe, readTable, readTable);
665
- React.useEffect(() => {
666
- if (tableId != null)
667
- client.fetchTable(tableId).catch(console.error);
668
- }, [client, tableId]);
669
- return table;
670
- }
671
- const getIndexes = (spans, index) => {
672
- const flattened = spans.reduce((a, s) => a.concat(s), []);
673
- if (index < 0 || index > flattened.length)
674
- throw new RangeError();
675
- let remainder = index;
676
- let rowIndex = 0;
677
- while (rowIndex < spans.length - 1 && remainder >= spans[rowIndex].length) {
678
- remainder -= spans[rowIndex].length;
679
- rowIndex += 1;
680
- }
681
- return [rowIndex, remainder];
682
- };
683
- function lengthDataToString(data) {
684
- if (typeof data === "object")
685
- return `${data.value}${data.unit}`;
686
- if (typeof data === "number")
687
- return `${data}px`;
688
- return data;
689
- }
690
- function paddingPropertyDataToStyle(data, defaultValue = {}) {
691
- var _a2, _b, _c, _d;
692
- const paddingTop = (_a2 = data.paddingTop) != null ? _a2 : defaultValue.paddingTop;
693
- const paddingRight = (_b = data.paddingRight) != null ? _b : defaultValue.paddingRight;
694
- const paddingBottom = (_c = data.paddingBottom) != null ? _c : defaultValue.paddingBottom;
695
- const paddingLeft = (_d = data.paddingLeft) != null ? _d : defaultValue.paddingLeft;
696
- const style = {};
697
- if (paddingTop != null)
698
- style.paddingTop = lengthDataToString(paddingTop);
699
- if (paddingRight != null)
700
- style.paddingRight = lengthDataToString(paddingRight);
701
- if (paddingBottom != null)
702
- style.paddingBottom = lengthDataToString(paddingBottom);
703
- if (paddingLeft != null)
704
- style.paddingLeft = lengthDataToString(paddingLeft);
705
- return style;
706
- }
707
- function marginPropertyDataToStyle(data, defaultValue = {}) {
708
- var _a2, _b, _c, _d;
709
- const marginTop = (_a2 = data.marginTop) != null ? _a2 : defaultValue.marginTop;
710
- const marginRight = (_b = data.marginRight) != null ? _b : defaultValue.marginRight;
711
- const marginBottom = (_c = data.marginBottom) != null ? _c : defaultValue.marginBottom;
712
- const marginLeft = (_d = data.marginLeft) != null ? _d : defaultValue.marginLeft;
713
- const style = {};
714
- if (marginTop != null)
715
- style.marginTop = lengthDataToString(marginTop);
716
- if (marginRight != null)
717
- style.marginRight = lengthDataToString(marginRight);
718
- if (marginBottom != null)
719
- style.marginBottom = lengthDataToString(marginBottom);
720
- if (marginLeft != null)
721
- style.marginLeft = lengthDataToString(marginLeft);
722
- return style;
723
- }
724
- function lengthPercentageDataToString(data) {
725
- if (typeof data === "object")
726
- return `${data.value}${data.unit}`;
727
- if (typeof data === "number")
728
- return `${data}px`;
729
- return data;
730
- }
731
- function borderRadiusPropertyDataToStyle(data, defaultValue = {}) {
732
- var _a2, _b, _c, _d;
733
- const borderTopLeftRadius = (_a2 = data.borderTopLeftRadius) != null ? _a2 : defaultValue.borderTopLeftRadius;
734
- const borderTopRightRadius = (_b = data.borderTopRightRadius) != null ? _b : defaultValue.borderTopRightRadius;
735
- const borderBottomRightRadius = (_c = data.borderBottomRightRadius) != null ? _c : defaultValue.borderBottomRightRadius;
736
- const borderBottomLeftRadius = (_d = data.borderBottomLeftRadius) != null ? _d : defaultValue.borderBottomLeftRadius;
737
- const style = {};
738
- if (borderTopLeftRadius != null) {
739
- style.borderTopLeftRadius = lengthPercentageDataToString(borderTopLeftRadius);
740
- }
741
- if (borderTopRightRadius != null) {
742
- style.borderTopRightRadius = lengthPercentageDataToString(borderTopRightRadius);
743
- }
744
- if (borderBottomRightRadius != null) {
745
- style.borderBottomRightRadius = lengthPercentageDataToString(borderBottomRightRadius);
746
- }
747
- if (borderBottomLeftRadius != null) {
748
- style.borderBottomLeftRadius = lengthPercentageDataToString(borderBottomLeftRadius);
749
- }
750
- return style;
751
- }
752
- function colorToString(color) {
753
- return color && color.swatch ? `hsla(${color.swatch.hue},${color.swatch.saturation}%,${color.swatch.lightness}%,${color.alpha})` : "";
754
- }
755
- function borderPropertyDataToStyle(data, defaultValue = {}) {
756
- var _a2, _b, _c, _d;
757
- const borderTop = (_a2 = data.borderTop) != null ? _a2 : defaultValue.borderTop;
758
- const borderRight = (_b = data.borderRight) != null ? _b : defaultValue.borderRight;
759
- const borderBottom = (_c = data.borderBottom) != null ? _c : defaultValue.borderBottom;
760
- const borderLeft = (_d = data.borderLeft) != null ? _d : defaultValue.borderLeft;
761
- const style = {};
762
- if (borderTop != null)
763
- style.borderTop = borderSideToString(borderTop);
764
- if (borderRight != null)
765
- style.borderRight = borderSideToString(borderRight);
766
- if (borderBottom != null)
767
- style.borderBottom = borderSideToString(borderBottom);
768
- if (borderLeft != null)
769
- style.borderLeft = borderSideToString(borderLeft);
770
- return style;
771
- }
772
- function borderSideToString(borderSide) {
773
- if (typeof borderSide === "string")
774
- return borderSide;
775
- if (typeof borderSide === "number")
776
- return `${borderSide}px`;
777
- const { width, color, style } = borderSide;
778
- return `${width != null ? width : 0}px ${style} ${color != null ? colorToString(color) : "black"}`;
779
- }
780
- function responsiveStyle(responsiveValues, join$1, strategy) {
781
- return join(responsiveValues, join$1, strategy).reduce((acc, { deviceId, value }) => {
782
- const device = getDevice(deviceId);
783
- const mediaQuery = getDeviceMediaQuery(device);
784
- return __spreadProps(__spreadValues({}, acc), {
785
- [mediaQuery]: __spreadValues(__spreadValues({}, acc[mediaQuery]), value)
786
- });
787
- }, {});
788
- }
789
- function responsiveWidth(widthData, defaultValue = "100%") {
790
- return __spreadValues({
791
- maxWidth: "100%"
792
- }, responsiveStyle([widthData], ([width = defaultValue]) => ({
793
- width: typeof width === "object" ? `${width.value}${width.unit}` : width
794
- })));
795
- }
796
- function responsivePadding(paddingData, defaultValue = {}) {
797
- return responsiveStyle([paddingData], ([padding = {}]) => paddingPropertyDataToStyle(padding, Object.assign({ paddingTop: 0, paddingRight: 0, paddingBottom: 0, paddingLeft: 0 }, defaultValue)));
798
- }
799
- function responsiveMargin(marginData, defaultValue = {}) {
800
- return responsiveStyle([marginData], ([margin = {}]) => marginPropertyDataToStyle(margin, Object.assign({ marginTop: 0, marginRight: "auto", marginBottom: 0, marginLeft: "auto" }, defaultValue)));
801
- }
802
- function responsiveBorderRadius(borderRadiusData, defaultValue = {}) {
803
- return responsiveStyle([borderRadiusData], ([borderRadius = {}]) => borderRadiusPropertyDataToStyle(borderRadius, Object.assign({
804
- borderTopLeftRadius: 0,
805
- borderTopRightRadius: 0,
806
- borderBottomRightRadius: 0,
807
- borderBottomLeftRadius: 0
808
- }, defaultValue)));
809
- }
810
- function responsiveBorder(borderData, defaultValue = {}) {
811
- return responsiveStyle([borderData], ([border = {}]) => borderPropertyDataToStyle(border, Object.assign({
812
- borderTop: "0px solid black",
813
- borderRight: "0px solid black",
814
- borderBottom: "0px solid black",
815
- borderLeft: "0px solid black"
816
- }, defaultValue)));
817
- }
818
- const floor = (d) => (v) => Math.floor(10 ** d * v) / 10 ** d;
819
- function responsiveGridItem(props) {
820
- return __spreadValues({
821
- display: "flex"
822
- }, responsiveStyle([props.grid, props.columnGap, props.rowGap], ([
823
- { spans, count } = { spans: [[12]], count: 12 },
824
- columnGap = { value: 0, unit: "px" },
825
- rowGap = { value: 0, unit: "px" }
826
- ]) => {
827
- const [rowIndex, columnIndex] = getIndexes(spans, props.index);
828
- const firstCol = columnIndex === 0;
829
- const lastCol = columnIndex === spans[rowIndex].length - 1;
830
- const span = spans[rowIndex][columnIndex];
831
- const fraction = floor(5)(span / count);
832
- const width = `${fraction} * (100% + ${columnGap.value}${columnGap.unit})`;
833
- const excessWidth = `${Number(firstCol) + Number(lastCol)} * ${columnGap.value}${columnGap.unit} / 2`;
834
- const iePrecisionError = "0.01px";
835
- const flexBasis = `calc(${width} - ${excessWidth} - ${iePrecisionError})`;
836
- const firstRow = rowIndex === 0;
837
- const lastRow = rowIndex === spans.length - 1;
838
- return span === 0 ? { display: "none" } : {
839
- flexBasis,
840
- minWidth: flexBasis,
841
- maxWidth: flexBasis,
842
- paddingLeft: firstCol ? 0 : `${columnGap.value / 2}${columnGap.unit}`,
843
- paddingRight: lastCol ? 0 : `${columnGap.value / 2}${columnGap.unit}`,
844
- paddingTop: firstRow ? 0 : `${rowGap.value / 2}${rowGap.unit}`,
845
- paddingBottom: lastRow ? 0 : `${rowGap.value / 2}${rowGap.unit}`
846
- };
847
- }));
848
- }
849
- const getBoxShadow = (shadows) => shadows.map(({ payload: { inset, offsetX, offsetY, blurRadius, spreadRadius, color } }) => `${inset ? "inset " : ""}${offsetX.toFixed(1)}px ${offsetY.toFixed(1)}px ${blurRadius}px ${spreadRadius}px ${color != null ? colorToString(color) : "rgba(0,0,0,0.2)"}`).filter(Boolean).join();
850
- function responsiveShadow(value) {
851
- return responsiveStyle([value], ([shadow = []]) => ({
852
- boxShadow: getBoxShadow(shadow)
853
- }));
854
- }
855
- function responsiveTextStyle(value) {
856
- return responsiveStyle([value], ([
857
- textStyle = {
858
- fontFamily: null,
859
- letterSpacing: null,
860
- fontSize: null,
861
- fontWeight: null,
862
- textTransform: [],
863
- fontStyle: []
864
- }
865
- ]) => {
866
- const {
867
- fontSize,
868
- fontWeight,
869
- fontStyle = [],
870
- textTransform = [],
871
- letterSpacing,
872
- fontFamily
873
- } = textStyle;
874
- return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, fontFamily == null ? {} : { fontFamily: `"${fontFamily}"` }), fontWeight == null ? {} : { fontWeight }), letterSpacing == null ? {} : { letterSpacing }), fontSize == null ? {} : { fontSize: `${fontSize.value}${fontSize.unit}` }), textTransform.includes("uppercase") ? { textTransform: "uppercase" } : {}), fontStyle.includes("italic") ? { fontStyle: "italic" } : {});
875
- });
876
- }
877
- exports.DEVICES = DEVICES;
878
- exports.FileQuery = FileQuery;
879
- exports.GlobalElementQuery = GlobalElementQuery;
880
- exports.GraphQLClient = GraphQLClient;
881
- exports.IntrospectedResourcesQuery = IntrospectedResourcesQuery;
882
- exports.MakeswiftClient = MakeswiftClient;
883
- exports.MakeswiftProvider = MakeswiftProvider;
884
- exports.PagePathnamesByIdQuery = PagePathnamesByIdQuery;
885
- exports.SwatchQuery = SwatchQuery;
886
- exports.TableQuery = TableQuery;
887
- exports.TypographiesQuery = TypographiesQuery;
888
- exports.TypographyQuery = TypographyQuery;
889
- exports.colorToString = colorToString;
890
- exports.deepEqual = deepEqual;
891
- exports.findDeviceOverride = findDeviceOverride;
892
- exports.getDeviceMediaQuery = getDeviceMediaQuery;
893
- exports.getIndexes = getIndexes;
894
- exports.lengthPercentageDataToString = lengthPercentageDataToString;
895
- exports.marginPropertyDataToStyle = marginPropertyDataToStyle;
896
- exports.paddingPropertyDataToStyle = paddingPropertyDataToStyle;
897
- exports.responsiveBorder = responsiveBorder;
898
- exports.responsiveBorderRadius = responsiveBorderRadius;
899
- exports.responsiveGridItem = responsiveGridItem;
900
- exports.responsiveMargin = responsiveMargin;
901
- exports.responsivePadding = responsivePadding;
902
- exports.responsiveShadow = responsiveShadow;
903
- exports.responsiveStyle = responsiveStyle;
904
- exports.responsiveTextStyle = responsiveTextStyle;
905
- exports.responsiveWidth = responsiveWidth;
906
- exports.shallowMergeFallbacks = shallowMergeFallbacks;
907
- exports.useFile = useFile;
908
- exports.useFiles = useFiles;
909
- exports.useGlobalElement = useGlobalElement;
910
- exports.useMakeswiftClient = useMakeswiftClient;
911
- exports.usePagePathnameSlice = usePagePathnameSlice;
912
- exports.useStyle = useStyle;
913
- exports.useSwatch = useSwatch;
914
- exports.useSwatches = useSwatches;
915
- exports.useTable = useTable;
916
- exports.useTypography = useTypography;
917
- //# sourceMappingURL=responsive-style.cjs.js.map