eddev 2.2.6 → 2.2.7

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 (188) hide show
  1. package/dist/app/lib/blocks/ContentBlocks.d.ts +1 -0
  2. package/dist/app/lib/blocks/ContentBlocks.d.ts.map +1 -1
  3. package/dist/app/lib/blocks/ContentBlocks.js +5 -0
  4. package/dist/app/lib/blocks/block-debugger.d.ts +1 -0
  5. package/dist/app/lib/blocks/block-debugger.d.ts.map +1 -1
  6. package/dist/app/lib/devtools/components/panels/AppDataPanel.d.ts +1 -0
  7. package/dist/app/lib/devtools/components/panels/AppDataPanel.d.ts.map +1 -1
  8. package/dist/app/lib/devtools/components/panels/AppDataPanel.js +4 -1
  9. package/dist/app/lib/devtools/components/panels/QueriesPanel.js +1 -1
  10. package/dist/app/lib/devtools/components/panels/RoutePanel.d.ts +4 -0
  11. package/dist/app/lib/devtools/components/panels/RoutePanel.d.ts.map +1 -1
  12. package/dist/app/lib/devtools/components/panels/RoutePanel.js +6 -1
  13. package/dist/app/lib/devtools/components/panels/StructurePanel.d.ts.map +1 -1
  14. package/dist/app/lib/devtools/components/panels/StructurePanel.js +25 -6
  15. package/dist/app/lib/devtools/components/ui/Expander.js +1 -1
  16. package/dist/app/lib/devtools/components/ui/Panel.d.ts +7 -0
  17. package/dist/app/lib/devtools/components/ui/Panel.d.ts.map +1 -1
  18. package/dist/app/lib/devtools/components/ui/Panel.js +73 -2
  19. package/dist/app/lib/hooks/query-hooks.d.ts +5 -4
  20. package/dist/app/lib/hooks/query-hooks.d.ts.map +1 -1
  21. package/dist/app/lib/hooks/query-hooks.js +1 -2
  22. package/dist/node/cli/display/CLIApp.d.ts.map +1 -1
  23. package/dist/node/cli/display/CLIApp.js +0 -1
  24. package/dist/node/utils/stateful-log.d.ts +1 -0
  25. package/dist/node/utils/stateful-log.d.ts.map +1 -1
  26. package/dist/node/utils/stateful-log.js +102 -6
  27. package/package.json +3 -2
  28. package/dist/app/entry/MetaTags.d.ts +0 -8
  29. package/dist/app/entry/MetaTags.d.ts.map +0 -1
  30. package/dist/app/entry/MetaTags.js +0 -32
  31. package/dist/app/entry/boot-admin.d.ts +0 -2
  32. package/dist/app/entry/boot-admin.d.ts.map +0 -1
  33. package/dist/app/entry/boot-admin.js +0 -12
  34. package/dist/app/entry/hydration-script.d.ts +0 -2
  35. package/dist/app/entry/hydration-script.d.ts.map +0 -1
  36. package/dist/app/entry/hydration-script.js +0 -18
  37. package/dist/app/entry/spa-root.d.ts +0 -2
  38. package/dist/app/entry/spa-root.d.ts.map +0 -1
  39. package/dist/app/entry/spa-root.js +0 -7
  40. package/dist/app/entry/ssr-root-client.d.ts +0 -7
  41. package/dist/app/entry/ssr-root-client.d.ts.map +0 -1
  42. package/dist/app/entry/ssr-root-client.js +0 -21
  43. package/dist/app/entry/ssr-root.d.ts +0 -11
  44. package/dist/app/entry/ssr-root.d.ts.map +0 -1
  45. package/dist/app/entry/ssr-root.js +0 -22
  46. package/dist/app/lib/admin/installFieldTypes.d.ts +0 -2
  47. package/dist/app/lib/admin/installFieldTypes.d.ts.map +0 -1
  48. package/dist/app/lib/admin/installFieldTypes.js +0 -94
  49. package/dist/app/lib/admin/runWidgets.d.ts +0 -2
  50. package/dist/app/lib/admin/runWidgets.d.ts.map +0 -1
  51. package/dist/app/lib/admin/runWidgets.js +0 -43
  52. package/dist/app/lib/blocks/editor/EditingContext.d.ts +0 -2
  53. package/dist/app/lib/blocks/editor/EditingContext.d.ts.map +0 -1
  54. package/dist/app/lib/blocks/editor/EditingContext.js +0 -31
  55. package/dist/app/lib/devtools/components/DevMenu.d.ts +0 -2
  56. package/dist/app/lib/devtools/components/DevMenu.d.ts.map +0 -1
  57. package/dist/app/lib/devtools/components/DevUI.d.ts +0 -16
  58. package/dist/app/lib/devtools/components/DevUI.d.ts.map +0 -1
  59. package/dist/app/lib/devtools/components/DevUI.js +0 -34
  60. package/dist/app/lib/devtools/components/GridIndicator.d.ts +0 -2
  61. package/dist/app/lib/devtools/components/GridIndicator.d.ts.map +0 -1
  62. package/dist/app/lib/devtools/components/GridIndicator.js +0 -30
  63. package/dist/app/lib/devtools/components/panels/monaco-graphql.worker.d.ts +0 -2
  64. package/dist/app/lib/devtools/components/panels/monaco-graphql.worker.d.ts.map +0 -1
  65. package/dist/app/lib/devtools/components/panels/monaco-graphql.worker.js +0 -9
  66. package/dist/app/lib/devtools/components/ui/Tabs.d.ts +0 -13
  67. package/dist/app/lib/devtools/components/ui/Tabs.d.ts.map +0 -1
  68. package/dist/app/lib/devtools/components/ui/Tabs.js +0 -7
  69. package/dist/app/lib/devtools/index.d.ts +0 -2
  70. package/dist/app/lib/devtools/index.d.ts.map +0 -1
  71. package/dist/app/lib/devtools/index.js +0 -1
  72. package/dist/app/lib/devtools/loader.d.ts +0 -2
  73. package/dist/app/lib/devtools/loader.d.ts.map +0 -1
  74. package/dist/app/lib/devtools/loader.js +0 -25
  75. package/dist/app/lib/devtools/tailwind.config.d.ts +0 -29
  76. package/dist/app/lib/devtools/tailwind.config.d.ts.map +0 -1
  77. package/dist/app/lib/devtools/tailwind.config.js +0 -29
  78. package/dist/app/lib/devtools/useQueryDebug.d.ts +0 -16
  79. package/dist/app/lib/devtools/useQueryDebug.d.ts.map +0 -1
  80. package/dist/app/lib/devtools/useQueryDebug.js +0 -10
  81. package/dist/app/lib/dynamic/index.d.ts +0 -2
  82. package/dist/app/lib/dynamic/index.d.ts.map +0 -1
  83. package/dist/app/lib/dynamic/index.js +0 -1
  84. package/dist/app/lib/integrations/gravityforms/createGravityFormComponent.d.ts +0 -93
  85. package/dist/app/lib/integrations/gravityforms/createGravityFormComponent.d.ts.map +0 -1
  86. package/dist/app/lib/integrations/gravityforms/createGravityFormComponent.js +0 -134
  87. package/dist/app/lib/integrations/gravityforms/field-types.d.ts +0 -141
  88. package/dist/app/lib/integrations/gravityforms/field-types.d.ts.map +0 -1
  89. package/dist/app/lib/integrations/gravityforms/field-types.js +0 -489
  90. package/dist/app/lib/integrations/gravityforms/index.d.ts +0 -5
  91. package/dist/app/lib/integrations/gravityforms/index.d.ts.map +0 -1
  92. package/dist/app/lib/integrations/gravityforms/index.js +0 -4
  93. package/dist/app/lib/integrations/gravityforms/types.d.ts +0 -64
  94. package/dist/app/lib/integrations/gravityforms/types.d.ts.map +0 -1
  95. package/dist/app/lib/integrations/gravityforms/types.js +0 -1
  96. package/dist/app/lib/integrations/gravityforms/useGravityForm.d.ts +0 -75
  97. package/dist/app/lib/integrations/gravityforms/useGravityForm.d.ts.map +0 -1
  98. package/dist/app/lib/integrations/gravityforms/useGravityForm.js +0 -288
  99. package/dist/app/lib/internal/finalize-rpc.d.ts +0 -18
  100. package/dist/app/lib/internal/finalize-rpc.d.ts.map +0 -1
  101. package/dist/app/lib/internal/finalize-rpc.js +0 -3
  102. package/dist/app/lib/internal/index.d.ts +0 -6
  103. package/dist/app/lib/internal/index.d.ts.map +0 -1
  104. package/dist/app/lib/internal/index.js +0 -5
  105. package/dist/app/lib/internal/internal-store.d.ts +0 -10
  106. package/dist/app/lib/internal/internal-store.d.ts.map +0 -1
  107. package/dist/app/lib/internal/internal-store.js +0 -7
  108. package/dist/app/lib/legacy-stitches/createStitches.d.ts +0 -616
  109. package/dist/app/lib/legacy-stitches/createStitches.d.ts.map +0 -1
  110. package/dist/app/lib/legacy-stitches/createStitches.js +0 -439
  111. package/dist/app/lib/legacy-stitches/index.d.ts +0 -2
  112. package/dist/app/lib/legacy-stitches/index.d.ts.map +0 -1
  113. package/dist/app/lib/legacy-stitches/index.js +0 -1
  114. package/dist/app/lib/routing/components/BackButton.d.ts +0 -50
  115. package/dist/app/lib/routing/components/BackButton.d.ts.map +0 -1
  116. package/dist/app/lib/routing/components/BackButton.js +0 -47
  117. package/dist/app/lib/routing/components/ClientOnly.d.ts +0 -13
  118. package/dist/app/lib/routing/components/ClientOnly.d.ts.map +0 -1
  119. package/dist/app/lib/routing/components/ClientOnly.js +0 -14
  120. package/dist/app/lib/routing/components/NativeLinkHandler.d.ts +0 -10
  121. package/dist/app/lib/routing/components/NativeLinkHandler.d.ts.map +0 -1
  122. package/dist/app/lib/routing/components/NativeLinkHandler.js +0 -23
  123. package/dist/app/lib/routing/components/RouteRenderer.d.ts +0 -10
  124. package/dist/app/lib/routing/components/RouteRenderer.d.ts.map +0 -1
  125. package/dist/app/lib/routing/components/RouteRenderer.js +0 -54
  126. package/dist/app/lib/routing/components/SSRRouter.d.ts +0 -12
  127. package/dist/app/lib/routing/components/SSRRouter.d.ts.map +0 -1
  128. package/dist/app/lib/routing/components/SSRRouter.js +0 -15
  129. package/dist/app/lib/routing/hooks/useRestorableState.d.ts +0 -7
  130. package/dist/app/lib/routing/hooks/useRestorableState.d.ts.map +0 -1
  131. package/dist/app/lib/routing/hooks/useRestorableState.js +0 -23
  132. package/dist/app/lib/routing/hooks/useRouteTransition.d.ts +0 -5
  133. package/dist/app/lib/routing/hooks/useRouteTransition.d.ts.map +0 -1
  134. package/dist/app/lib/routing/hooks/useRouteTransition.js +0 -12
  135. package/dist/app/lib/routing/hooks/useSearchParams.d.ts +0 -98
  136. package/dist/app/lib/routing/hooks/useSearchParams.d.ts.map +0 -1
  137. package/dist/app/lib/routing/hooks/useSearchParams.js +0 -131
  138. package/dist/app/lib/routing/index.d.ts +0 -17
  139. package/dist/app/lib/routing/index.d.ts.map +0 -1
  140. package/dist/app/lib/routing/index.js +0 -16
  141. package/dist/app/lib/runtime/index.d.ts +0 -3
  142. package/dist/app/lib/runtime/index.d.ts.map +0 -1
  143. package/dist/app/lib/runtime/index.js +0 -2
  144. package/dist/app/lib/views/defineView.d.ts +0 -5
  145. package/dist/app/lib/views/defineView.d.ts.map +0 -1
  146. package/dist/app/lib/views/defineView.js +0 -3
  147. package/dist/app/lib/views/index.d.ts +0 -2
  148. package/dist/app/lib/views/index.d.ts.map +0 -1
  149. package/dist/app/lib/views/index.js +0 -1
  150. package/dist/app/server/index.d.ts +0 -6
  151. package/dist/app/server/index.d.ts.map +0 -1
  152. package/dist/app/server/index.js +0 -5
  153. package/dist/app/server/proxy-wp-admin.d.ts +0 -3
  154. package/dist/app/server/proxy-wp-admin.d.ts.map +0 -1
  155. package/dist/app/server/proxy-wp-admin.js +0 -138
  156. package/dist/app/server/render-ai-page.d.ts +0 -13
  157. package/dist/app/server/render-ai-page.d.ts.map +0 -1
  158. package/dist/app/server/render-ai-page.js +0 -102
  159. package/dist/app/server/render-ssr-page.d.ts +0 -32
  160. package/dist/app/server/render-ssr-page.d.ts.map +0 -1
  161. package/dist/app/server/render-ssr-page.js +0 -250
  162. package/dist/app/server/rpc.d.ts +0 -33
  163. package/dist/app/server/rpc.d.ts.map +0 -1
  164. package/dist/app/server/rpc.js +0 -18
  165. package/dist/app/server/server-context.d.ts +0 -83
  166. package/dist/app/server/server-context.d.ts.map +0 -1
  167. package/dist/app/server/server-context.js +0 -480
  168. package/dist/app/server/server-custom-config.d.ts +0 -3
  169. package/dist/app/server/server-custom-config.d.ts.map +0 -1
  170. package/dist/app/server/server-custom-config.js +0 -1
  171. package/dist/app/server/utils/content-security.d.ts +0 -26
  172. package/dist/app/server/utils/content-security.d.ts.map +0 -1
  173. package/dist/app/server/utils/content-security.js +0 -124
  174. package/dist/app/server/utils/headers.d.ts +0 -6
  175. package/dist/app/server/utils/headers.d.ts.map +0 -1
  176. package/dist/app/server/utils/headers.js +0 -28
  177. package/dist/app/server/utils/replace-host.d.ts +0 -11
  178. package/dist/app/server/utils/replace-host.d.ts.map +0 -1
  179. package/dist/app/server/utils/replace-host.js +0 -36
  180. package/dist/app/server/utils/swr-cache.d.ts +0 -5
  181. package/dist/app/server/utils/swr-cache.d.ts.map +0 -1
  182. package/dist/app/server/utils/swr-cache.js +0 -31
  183. package/dist/app/utils/hydration-debugger.d.ts +0 -14
  184. package/dist/app/utils/hydration-debugger.d.ts.map +0 -1
  185. package/dist/app/utils/hydration-debugger.js +0 -11
  186. package/dist/app/utils/wp.d.ts +0 -27
  187. package/dist/app/utils/wp.d.ts.map +0 -1
  188. package/dist/app/utils/wp.js +0 -1
@@ -1,439 +0,0 @@
1
- import { createStitches as createBaseStitches, } from "../../../../stitches-archive/index.js";
2
- const typeKeyMap = {
3
- fontSize: "fontSizes",
4
- fontFamily: "fonts",
5
- lineHeight: "lineHeights",
6
- letterSpacing: "letterSpacings",
7
- fontWeight: "fontWeights",
8
- };
9
- export function parseBreakpoints(names, medias) {
10
- const breakpoints = [];
11
- // Add an initial breakpoint
12
- breakpoints.push({ key: "initial", min: "0px", max: null });
13
- // Parse each breakpoint
14
- for (const key in medias) {
15
- if (!names.includes(key))
16
- continue;
17
- const media = medias[key];
18
- const minMatch = media.match(/min-width: ([0-9]+[a-z]+)/);
19
- const maxMatch = media.match(/max-width: ([0-9]+[a-z]+)/);
20
- if (!minMatch && !maxMatch)
21
- continue;
22
- breakpoints.push({
23
- key,
24
- min: minMatch ? minMatch[1] : null,
25
- max: maxMatch ? maxMatch[1] : null,
26
- });
27
- }
28
- // Ensure each breakpoint has a min/max value (except for first and last)
29
- for (let i = 0; i < breakpoints.length; i++) {
30
- const bp = breakpoints[i];
31
- const prev = breakpoints[i - 1];
32
- const next = breakpoints[i + 1];
33
- if (bp.min === null && prev && prev.max) {
34
- bp.min = prev.max;
35
- }
36
- if (bp.max === null && next && next.min) {
37
- bp.max = next.min;
38
- }
39
- }
40
- return breakpoints;
41
- }
42
- const unitless = (value) => parseFloat(value);
43
- function parseTypography(theme, breakpoints, typography) {
44
- const globals = {};
45
- const typeVariants = {};
46
- breakpoints.forEach((bp) => (globals["@" + bp.key] = {}));
47
- globals["@editor"] = {};
48
- const resolveValue = (scale, value) => {
49
- if (typeof value === "string" && value.match(/^\$[a-z0-9\-\_]+$/)) {
50
- // Single scale
51
- return theme[scale][value.replace("$", "")];
52
- }
53
- else {
54
- return value;
55
- }
56
- };
57
- const resolveThemeVar = (scale, value) => {
58
- if (typeof value === "string" && value.match(/^\$[a-z0-9\-\_]+$/)) {
59
- // Single scale
60
- return "$" + scale + value;
61
- }
62
- else {
63
- return value;
64
- }
65
- };
66
- for (const name in typography) {
67
- const style = typography[name];
68
- const variant = {};
69
- typeVariants[name] = variant;
70
- for (const key in style) {
71
- const value = style[key];
72
- const varName = `--type-${name}-${key}`;
73
- variant[key] = `var(${varName})`;
74
- const tokenPrefix = typeKeyMap[key];
75
- if (typeof value === "string" || typeof value === "number") {
76
- // A simple string or number value is used
77
- globals["@initial"][varName] = resolveThemeVar(tokenPrefix, value);
78
- }
79
- else if (value && typeof value === "object") {
80
- // A responsive object value
81
- const unit = key === "lineHeight" ? "%" : "px";
82
- const [tokenGlobals, initial] = getResponsiveObjectStyles(breakpoints, value, varName, unit);
83
- for (const key in tokenGlobals) {
84
- globals[key] = { ...globals[key], ...tokenGlobals[key] };
85
- }
86
- // const entries = Object.entries(value)
87
- // entries.forEach(([bpName, responsiveValue], i) => {
88
- // if (Array.isArray(responsiveValue)) {
89
- // responsiveValue = responsiveValue[0]
90
- // // An array in the format [value] signifies font locking between the current breakpoint and the next defined one
91
- // const minSize = breakpoints.find((bp) => "@" + bp.key === bpName)?.min
92
- // const nextBreakpoint = breakpoints.find((bp) => "@" + bp.key === entries[i + 1]?.[0])
93
- // if (!nextBreakpoint)
94
- // throw new Error(
95
- // `Cannot create responsive '${key}' for '${name}' at breakpoint '${bpName}', since it is the last-defined breakpoint. Your last size should be a string/number/token.`
96
- // )
97
- // const maxSize = nextBreakpoint.min
98
- // let responsiveValue2 = (value as any)["@" + nextBreakpoint.key]
99
- // if (Array.isArray(responsiveValue2)) responsiveValue2 = responsiveValue2[0]
100
- // let size1 = resolveValue(tokenPrefix, responsiveValue)
101
- // let size2 = resolveValue(tokenPrefix, responsiveValue2)
102
- // responsiveValue = `calc(${size1} + (100vw - ${minSize}) / (${unitless(maxSize)} - ${unitless(
103
- // minSize
104
- // )}) * (${unitless(size2)} - ${unitless(size1)}))`
105
- // }
106
- // globals[bpName][varName] = responsiveValue
107
- // })
108
- }
109
- }
110
- }
111
- return { globalTypography: globals, typeVariants };
112
- }
113
- function parseGrid(theme, media, grid) {
114
- const globalGrid = {};
115
- const resolveThemeVar = (scale, value) => {
116
- if (typeof value === "string" && value.match(/^\$[a-z0-9\-\_]+$/)) {
117
- // Single scale
118
- return "$" + scale + value;
119
- }
120
- else {
121
- return value;
122
- }
123
- };
124
- for (let [bpName, breakpoint] of Object.entries(grid.breakpoints)) {
125
- globalGrid[bpName] = {
126
- "--grid-columns": grid.columns,
127
- "--grid-outer-width": breakpoint.container,
128
- "--grid-inner-width": `calc(${breakpoint.container} - ${resolveThemeVar("spaces", breakpoint.margin)} * 2)`,
129
- "--grid-gutter": breakpoint.gutter,
130
- "--grid-margin": breakpoint.margin,
131
- "--grid-col-width": `calc((var(--grid-inner-width) - (${grid.columns - 1} * var(--grid-gutter))) / ${grid.columns})`,
132
- };
133
- }
134
- return { gridVariants: {}, globalGrid };
135
- }
136
- function parseResponsiveValue(val) {
137
- if (Array.isArray(val)) {
138
- return {
139
- ...parseResponsiveValue(val[0]),
140
- lerpStart: true,
141
- };
142
- }
143
- else if (typeof val === "string") {
144
- if (val.match(/^x[0-9\.]+$/)) {
145
- return {
146
- lerpStart: false,
147
- type: "multiplier",
148
- value: parseFloat(val.replace(/^x/, "")),
149
- };
150
- }
151
- else if (val.match(/^[0-9\.]+%$/)) {
152
- return {
153
- lerpStart: false,
154
- type: "percent",
155
- value: parseFloat(val.replace(/^x/, "")),
156
- };
157
- }
158
- else if (val.match(/^[0-9\.]+px$/)) {
159
- return {
160
- lerpStart: false,
161
- type: "px",
162
- value: parseFloat(val.replace(/px$/, "")),
163
- };
164
- }
165
- }
166
- else if (typeof val === "number") {
167
- return {
168
- lerpStart: false,
169
- type: "number",
170
- value: val,
171
- };
172
- }
173
- else if (val === undefined || val === null) {
174
- return {
175
- lerpStart: false,
176
- type: "undefined",
177
- };
178
- }
179
- return {
180
- lerpStart: false,
181
- type: "unknown",
182
- value: val,
183
- };
184
- }
185
- export function parseResponsiveObject(breakpoints, object) {
186
- // Breakpoint hash
187
- const breakpointHash = {};
188
- for (let bp of breakpoints) {
189
- breakpointHash[bp.key] = {
190
- min: bp.min ? parseFloat(bp.min) : null,
191
- max: bp.max ? parseFloat(bp.max) : null,
192
- };
193
- }
194
- const result = [];
195
- let lerpStart = "initial";
196
- let lastDefined = "initial";
197
- let concreteValues = {};
198
- for (let bp of breakpoints) {
199
- const value = parseResponsiveValue(object["@" + bp.key]);
200
- const defined = value.type !== "undefined";
201
- let base = !defined || value.type === "multiplier" ? lastDefined : bp.key;
202
- lerpStart = value.lerpStart ? bp.key : lerpStart && !defined ? lerpStart : null;
203
- if (value.type === "px" || value.type === "number") {
204
- concreteValues[bp.key] = value.value;
205
- }
206
- else if (value.type === "multiplier") {
207
- concreteValues[bp.key] = value.value * concreteValues[base];
208
- }
209
- else if (value.type === "percent") {
210
- concreteValues[bp.key] = value.value;
211
- }
212
- result.push({
213
- ...value,
214
- defined: defined,
215
- breakpoint: bp.key,
216
- lastBreakpoint: lastDefined,
217
- baseBreakpoint: base,
218
- lerping: lerpStart
219
- ? {
220
- fromBP: lerpStart,
221
- toBP: null,
222
- minMedia: 0,
223
- maxMedia: 0,
224
- minValue: 0,
225
- maxValue: 0,
226
- }
227
- : undefined,
228
- concreteValue: concreteValues[bp.key],
229
- });
230
- if (defined) {
231
- lastDefined = bp.key;
232
- }
233
- }
234
- let nextBreakpoints = [];
235
- let lastBreakpoint = null;
236
- for (let i = breakpoints.length - 1; i >= 0; i--) {
237
- const bp = breakpoints[i];
238
- nextBreakpoints[i] = lastBreakpoint;
239
- if (result[i].defined) {
240
- lastBreakpoint = bp.key;
241
- }
242
- }
243
- result.forEach((item, i) => {
244
- if (item.lerping) {
245
- item.lerping.toBP = nextBreakpoints[i];
246
- }
247
- });
248
- result.forEach((item, i) => {
249
- const lerp = item.lerping;
250
- if (lerp) {
251
- const fromBP = lerp.fromBP ? breakpointHash[lerp.fromBP] : null;
252
- const toBP = lerp.toBP ? breakpointHash[lerp.toBP] : null;
253
- if (!fromBP || fromBP.min === null) {
254
- throw new Error(`Cannot create responsive style for first breakpoint`);
255
- }
256
- if (!toBP || toBP.min === null) {
257
- throw new Error(`Cannot create responsive style for last breakpoint`);
258
- }
259
- lerp.minMedia = fromBP.min;
260
- lerp.maxMedia = toBP.min;
261
- lerp.minValue = item.concreteValue;
262
- lerp.maxValue = result.find((o) => o.breakpoint === lerp.toBP).concreteValue;
263
- }
264
- });
265
- return result;
266
- }
267
- export function getResponsiveObjectStyles(breakpoints, object, varName, unit = "px") {
268
- // Prescale object
269
- object = { ...object };
270
- const parsed = parseResponsiveObject(breakpoints, object);
271
- const globals = {};
272
- for (let atom of parsed) {
273
- if (atom.lerpStart && atom.lerping) {
274
- const lerp = atom.lerping;
275
- globals["@" + atom.breakpoint] = {
276
- [varName]: `calc(${lerp.minValue}${unit} + (100vw - ${lerp.minMedia}${unit}) / (${lerp.maxMedia} - ${lerp.minMedia}) * (${lerp.maxValue} - ${lerp.minValue}))`,
277
- };
278
- }
279
- else if (atom.concreteValue) {
280
- globals["@" + atom.breakpoint] = {
281
- [varName]: atom.concreteValue + unit,
282
- };
283
- }
284
- else if (atom.defined) {
285
- globals["@" + atom.breakpoint] = {
286
- [varName]: atom.value,
287
- };
288
- }
289
- }
290
- return [globals, globals["@initial"]?.[varName]];
291
- }
292
- // parseResponsiveTokens({'@initial': blah, '@desktop': blah}, breakpoints, )
293
- export function parseResponsiveTokens(theme, breakpoints) {
294
- const globalResponsive = {
295
- "@initial": {},
296
- };
297
- const initialResponsive = {};
298
- for (const scale in theme) {
299
- const initials = {};
300
- initialResponsive[scale] = initials;
301
- for (const key in theme[scale]) {
302
- const val = theme[scale][key];
303
- if (val && typeof val === "object") {
304
- const [tokenGlobals, initial] = getResponsiveObjectStyles(breakpoints, val, "--" + scale + "-" + key);
305
- for (const bp in tokenGlobals) {
306
- globalResponsive[bp] = {
307
- ...globalResponsive[bp],
308
- ...tokenGlobals[bp],
309
- };
310
- }
311
- initials[key] = initial;
312
- }
313
- else {
314
- initials[key] = val;
315
- }
316
- }
317
- }
318
- return { initialResponsive, globalResponsive };
319
- }
320
- export function createStitches(config) {
321
- const breakpoints = parseBreakpoints(config.breakpoints, config.media);
322
- const { typeVariants, globalTypography } = parseTypography(config.theme, breakpoints, config.typography);
323
- const { gridVariants, globalGrid } = parseGrid(config.theme, config.media, config.grid);
324
- const { initialResponsive, globalResponsive } = parseResponsiveTokens(config.responsive, breakpoints);
325
- const stitches = createBaseStitches({
326
- // prefix: config.prefix,
327
- media: {
328
- initial: "",
329
- ...config.media,
330
- },
331
- theme: { ...config.theme, ...initialResponsive },
332
- themeMap: config.themeMap,
333
- utils: {
334
- ...(config.utils || {}),
335
- typography: (key) => typeVariants[key],
336
- m: (value) => ({
337
- margin: value,
338
- }),
339
- mt: (value) => ({
340
- marginTop: value,
341
- }),
342
- mr: (value) => ({
343
- marginRight: value,
344
- }),
345
- mb: (value) => ({
346
- marginBottom: value,
347
- }),
348
- ml: (value) => ({
349
- marginLeft: value,
350
- }),
351
- mx: (value) => ({
352
- marginLeft: value,
353
- marginRight: value,
354
- }),
355
- my: (value) => ({
356
- marginTop: value,
357
- marginBottom: value,
358
- }),
359
- p: (value) => ({
360
- padding: value,
361
- }),
362
- pt: (value) => ({
363
- paddingTop: value,
364
- }),
365
- pr: (value) => ({
366
- paddingRight: value,
367
- }),
368
- pb: (value) => ({
369
- paddingBottom: value,
370
- }),
371
- pl: (value) => ({
372
- paddingLeft: value,
373
- }),
374
- px: (value) => ({
375
- paddingLeft: value,
376
- paddingRight: value,
377
- }),
378
- py: (value) => ({
379
- paddingTop: value,
380
- paddingBottom: value,
381
- }),
382
- cols: (value) => ({
383
- gridColumn: `auto / span ${value}`,
384
- "--grid-columns": value,
385
- }),
386
- },
387
- });
388
- // Typography globals
389
- const typeGlobals = {};
390
- Object.entries(globalTypography).forEach(([key, styles]) => {
391
- if (key === "@initial") {
392
- typeGlobals[":root"] = styles;
393
- }
394
- else if (key === "@editor") {
395
- typeGlobals[":root body.block-editor-page"] = styles;
396
- }
397
- else {
398
- typeGlobals[key] = { ":root": styles };
399
- }
400
- });
401
- stitches.globalCss(typeGlobals)();
402
- // Grid globals
403
- const gridGlobals = {};
404
- Object.entries(globalGrid).forEach(([key, styles]) => {
405
- if (key === "@initial") {
406
- gridGlobals[":root"] = styles;
407
- }
408
- else if (key === "@editor") {
409
- gridGlobals[":root body.block-editor-page"] = styles;
410
- }
411
- else {
412
- gridGlobals[key] = { ":root": styles };
413
- }
414
- });
415
- stitches.globalCss(gridGlobals)();
416
- const responsiveGlobals = {};
417
- Object.entries(globalResponsive).forEach(([key, styles]) => {
418
- if (key === "@initial") {
419
- responsiveGlobals[":root"] = styles;
420
- }
421
- else if (key === "@editor") {
422
- responsiveGlobals[":root body.block-editor-page"] = styles;
423
- }
424
- else {
425
- responsiveGlobals[key] = { ":root": styles };
426
- }
427
- });
428
- stitches.globalCss(responsiveGlobals)();
429
- const responsiveTokens = {};
430
- return {
431
- ...stitches,
432
- originalConfig: config,
433
- breakpoints,
434
- typeVariants,
435
- gridVariants,
436
- responsiveTokens,
437
- responsiveGlobals,
438
- };
439
- }
@@ -1,2 +0,0 @@
1
- export * from "./createStitches.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app/lib/legacy-stitches/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
@@ -1 +0,0 @@
1
- export * from "./createStitches.js";
@@ -1,50 +0,0 @@
1
- import { ReactNode } from "react";
2
- import { RouteState } from "../types";
3
- type BackButtonProps = {
4
- /**
5
- * An optional matching function, which will stop the render button from appearing unless the function returns true.
6
- *
7
- * The below example will only render a back button if the last route was a project archive.
8
- *
9
- * eg. `filter={(route) => route.view === 'archive-projects'}`
10
- *
11
- * @param route The last route in the history stack.
12
- */
13
- filter?: (route: RouteState) => boolean;
14
- /**
15
- * Whether to use the top-most "global" route, or the "context" route.
16
- *
17
- * The "global" route is the top-most route, reflected in the URL bar.
18
- *
19
- * The "context" route will be the route that is currently being rendered, which may be different to the global route when using modals/overlays/route stacks/transitions.
20
- *
21
- * @default "context"
22
- */
23
- mode?: "global" | "context";
24
- /**
25
- * An optional href, which will be used if no back route is found.
26
- *
27
- * When used, the back button will always render.
28
- */
29
- fallbackHref?: string;
30
- /**
31
- * A function to render the back button, if one should be rendered.
32
- *
33
- * Receives a `route` prop to further inspect the route, and an `onClick` function to navigate back.
34
- *
35
- * @param props
36
- * @returns
37
- */
38
- render: (props: {
39
- route: RouteState;
40
- onClick: (e?: any) => void;
41
- }) => ReactNode;
42
- };
43
- /**
44
- * Display a back button that will navigate to the previous page in the router's history.
45
- *
46
- * This will allow you to render a back button on the condition that the back button will not send the user to a different website.
47
- */
48
- export declare function BackButton(props: BackButtonProps): ReactNode;
49
- export {};
50
- //# sourceMappingURL=BackButton.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BackButton.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/routing/components/BackButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAW,MAAM,OAAO,CAAA;AAI1C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAGrC,KAAK,eAAe,GAAG;IACrB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAA;IACvC;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC3B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;;;;OAOG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,UAAU,CAAC;QAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;KAAE,KAAK,SAAS,CAAA;CAChF,CAAA;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,aAmChD"}
@@ -1,47 +0,0 @@
1
- import { useMemo } from "react";
2
- import { useRoute } from "../hooks/useRoute";
3
- import { useRouter } from "../hooks/useRouter";
4
- import { useRouterState } from "../hooks/useRouterState";
5
- import { getLinkHandlerMode } from "../utils";
6
- /**
7
- * Display a back button that will navigate to the previous page in the router's history.
8
- *
9
- * This will allow you to render a back button on the condition that the back button will not send the user to a different website.
10
- */
11
- export function BackButton(props) {
12
- const router = useRouter();
13
- const prevRoute = useRouterState((state) => state.history[state.history.length - 2]);
14
- const contextRoute = useRoute();
15
- const activeRoute = useRouterState((state) => state.activeRoute);
16
- const route = props.mode === "global" ? activeRoute : contextRoute;
17
- const backAction = useMemo(() => {
18
- if (prevRoute && (!props.filter || props.filter(prevRoute))) {
19
- return (e) => {
20
- const { mode } = getLinkHandlerMode(e, prevRoute.uri);
21
- if (mode === "navigate") {
22
- e.preventDefault();
23
- history.back();
24
- // history.length
25
- }
26
- else if (mode === "ignore") {
27
- e.preventDefault();
28
- }
29
- };
30
- }
31
- else if (props.fallbackHref) {
32
- return (e) => {
33
- const { mode } = getLinkHandlerMode(e, props.fallbackHref);
34
- if (mode === "navigate") {
35
- e.preventDefault();
36
- router.navigate(props.fallbackHref);
37
- }
38
- else if (mode === "ignore") {
39
- e.preventDefault();
40
- }
41
- };
42
- }
43
- }, [route, props.filter, props.fallbackHref]);
44
- if (backAction) {
45
- return props.render ? props.render({ route: prevRoute, onClick: backAction }) : null;
46
- }
47
- }
@@ -1,13 +0,0 @@
1
- import { PropsWithChildren } from "react";
2
- type Props = PropsWithChildren<{
3
- /** An optional fallback, to be shown before the client component. */
4
- fallback?: React.ReactNode;
5
- }>;
6
- /**
7
- * Renders children, but only on the client.
8
- *
9
- * The optional 'fallback' prop can be used to show a loading state or placeholder content while the client bundle is loading.
10
- */
11
- export declare function ClientOnly(props: Props): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
12
- export {};
13
- //# sourceMappingURL=ClientOnly.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClientOnly.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/routing/components/ClientOnly.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAGnD,KAAK,KAAK,GAAG,iBAAiB,CAAC;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAC,CAAA;AAEF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,oHAMtC"}
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Fragment } from "react";
3
- import { useHydrating } from "../hooks/useHydrating.js";
4
- /**
5
- * Renders children, but only on the client.
6
- *
7
- * The optional 'fallback' prop can be used to show a loading state or placeholder content while the client bundle is loading.
8
- */
9
- export function ClientOnly(props) {
10
- const mounted = useHydrating();
11
- if (mounted)
12
- return props.fallback ?? null;
13
- return _jsx(Fragment, { children: props.children });
14
- }
@@ -1,10 +0,0 @@
1
- import { HTMLProps, JSX } from "react";
2
- type Props<T extends keyof JSX.IntrinsicElements> = {
3
- as?: T;
4
- } & HTMLProps<T>;
5
- /**
6
- * Use this component to wrap any HTML element that contains <a> tags that are not already handled by the router.
7
- */
8
- export declare function NativeLinkHandler<T extends keyof JSX.IntrinsicElements = "div">({ as, ...props }: Props<T>): import("react/jsx-runtime").JSX.Element;
9
- export {};
10
- //# sourceMappingURL=NativeLinkHandler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NativeLinkHandler.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/routing/components/NativeLinkHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAGtD,KAAK,KAAK,CAAC,CAAC,SAAS,MAAM,GAAG,CAAC,iBAAiB,IAAI;IAClD,EAAE,CAAC,EAAE,CAAC,CAAA;CACP,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;AAEhB;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,CAAC,iBAAiB,GAAG,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,2CAqB1G"}
@@ -1,23 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useRouter } from "../hooks/useRouter";
3
- /**
4
- * Use this component to wrap any HTML element that contains <a> tags that are not already handled by the router.
5
- */
6
- export function NativeLinkHandler({ as, ...props }) {
7
- const handleClickEvent = useRouter((r) => r.handleClickEvent);
8
- const Comp = (as ?? "div");
9
- return (_jsx(Comp, { ...props, onClick: (e) => {
10
- if (props.onClick)
11
- props.onClick(e);
12
- if (e.target instanceof HTMLAnchorElement) {
13
- const link = e.target;
14
- handleClickEvent?.(e, link.href, false, link);
15
- }
16
- else if (e.target instanceof HTMLElement) {
17
- const link = e.target.closest("a");
18
- if (link) {
19
- handleClickEvent?.(e, link.href, false, link);
20
- }
21
- }
22
- } }));
23
- }
@@ -1,10 +0,0 @@
1
- import { RouteState } from "../types.js";
2
- export declare const AppRenderer: import("react").MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
3
- export declare function MainRoute(): import("react/jsx-runtime").JSX.Element;
4
- export declare function RouteDisplay(props: {
5
- route: RouteState;
6
- }): import("react/jsx-runtime").JSX.Element;
7
- export declare namespace RouteDisplay {
8
- var displayName: string;
9
- }
10
- //# sourceMappingURL=RouteRenderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RouteRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/routing/components/RouteRenderer.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAQxC,eAAO,MAAM,WAAW,oFAgBtB,CAAA;AAEF,wBAAgB,SAAS,4CAGxB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,UAAU,CAAA;CAAE,2CA2CxD;yBA3Ce,YAAY"}