@makeswift/runtime 0.23.9 → 0.23.10

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.
@@ -37,7 +37,7 @@ async function handler(...args) {
37
37
  const supportsDraftMode = (0, import_ts_pattern.match)(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
38
38
  const supportsWebhook = (0, import_ts_pattern.match)(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
39
39
  const body = {
40
- version: "0.23.9",
40
+ version: "0.23.10",
41
41
  previewMode: supportsPreviewMode,
42
42
  draftMode: supportsDraftMode,
43
43
  interactionMode: true,
@@ -39,8 +39,8 @@ var import_css = require("@emotion/css");
39
39
  var import_navigation = require("next/navigation");
40
40
  var import_react = require("react");
41
41
  const CacheContext = (0, import_react.createContext)(import_css.cache);
42
- const createRootStyleCache = () => {
43
- const cache2 = (0, import_cache.default)({ key: "css" });
42
+ const createRootStyleCache = ({ key }) => {
43
+ const cache2 = (0, import_cache.default)({ key });
44
44
  cache2.compat = true;
45
45
  const prevInsert = cache2.insert;
46
46
  let inserted = [];
@@ -58,8 +58,11 @@ const createRootStyleCache = () => {
58
58
  };
59
59
  return { cache: cache2, flush };
60
60
  };
61
- function RootStyleRegistry({ children }) {
62
- const [{ cache: cache2, flush }] = (0, import_react.useState)(() => createRootStyleCache());
61
+ function RootStyleRegistry({
62
+ children,
63
+ cacheKey
64
+ }) {
65
+ const [{ cache: cache2, flush }] = (0, import_react.useState)(() => createRootStyleCache({ key: cacheKey ?? "mswft" }));
63
66
  (0, import_navigation.useServerInsertedHTML)(() => {
64
67
  const names = flush();
65
68
  if (names.length === 0)
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/next/root-style-registry.tsx"],"sourcesContent":["'use client'\n\nimport createCache, { EmotionCache } from '@emotion/cache'\nimport { cache } from '@emotion/css'\nimport { useServerInsertedHTML } from 'next/navigation'\nimport { ReactNode, createContext, useContext, useState } from 'react'\n\nconst CacheContext = createContext(cache)\n\nconst createRootStyleCache = () => {\n const cache = createCache({ key: 'css' })\n cache.compat = true\n\n const prevInsert = cache.insert\n let inserted: string[] = []\n\n cache.insert = (...args) => {\n const serialized = args[1]\n if (cache.inserted[serialized.name] === undefined) {\n inserted.push(serialized.name)\n }\n return prevInsert(...args)\n }\n\n const flush = () => {\n const prevInserted = inserted\n inserted = []\n return prevInserted\n }\n\n return { cache, flush }\n}\n\nexport function RootStyleRegistry({ children }: { children: ReactNode }) {\n const [{ cache, flush }] = useState(() => createRootStyleCache())\n\n useServerInsertedHTML(() => {\n const names = flush()\n if (names.length === 0) return null\n let styles = ''\n for (const name of names) {\n styles += cache.inserted[name]\n }\n\n return (\n <style\n data-emotion={`${cache.key} ${names.join(' ')}`}\n dangerouslySetInnerHTML={{\n __html: styles,\n }}\n />\n )\n })\n\n return <CacheContext.Provider value={cache}>{children}</CacheContext.Provider>\n}\n\nexport function useCache(): EmotionCache {\n return useContext(CacheContext)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6CM;AA3CN,mBAA0C;AAC1C,iBAAsB;AACtB,wBAAsC;AACtC,mBAA+D;AAE/D,MAAM,mBAAe,4BAAc,gBAAK;AAExC,MAAM,uBAAuB,MAAM;AACjC,QAAMA,aAAQ,aAAAC,SAAY,EAAE,KAAK,MAAM,CAAC;AACxC,EAAAD,OAAM,SAAS;AAEf,QAAM,aAAaA,OAAM;AACzB,MAAI,WAAqB,CAAC;AAE1B,EAAAA,OAAM,SAAS,IAAI,SAAS;AAC1B,UAAM,aAAa,KAAK,CAAC;AACzB,QAAIA,OAAM,SAAS,WAAW,IAAI,MAAM,QAAW;AACjD,eAAS,KAAK,WAAW,IAAI;AAAA,IAC/B;AACA,WAAO,WAAW,GAAG,IAAI;AAAA,EAC3B;AAEA,QAAM,QAAQ,MAAM;AAClB,UAAM,eAAe;AACrB,eAAW,CAAC;AACZ,WAAO;AAAA,EACT;AAEA,SAAO,EAAE,OAAAA,QAAO,MAAM;AACxB;AAEO,SAAS,kBAAkB,EAAE,SAAS,GAA4B;AACvE,QAAM,CAAC,EAAE,OAAAA,QAAO,MAAM,CAAC,QAAI,uBAAS,MAAM,qBAAqB,CAAC;AAEhE,+CAAsB,MAAM;AAC1B,UAAM,QAAQ,MAAM;AACpB,QAAI,MAAM,WAAW;AAAG,aAAO;AAC/B,QAAI,SAAS;AACb,eAAW,QAAQ,OAAO;AACxB,gBAAUA,OAAM,SAAS,IAAI;AAAA,IAC/B;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,gBAAc,GAAGA,OAAM,GAAG,IAAI,MAAM,KAAK,GAAG,CAAC;AAAA,QAC7C,yBAAyB;AAAA,UACvB,QAAQ;AAAA,QACV;AAAA;AAAA,IACF;AAAA,EAEJ,CAAC;AAED,SAAO,4CAAC,aAAa,UAAb,EAAsB,OAAOA,QAAQ,UAAS;AACxD;AAEO,SAAS,WAAyB;AACvC,aAAO,yBAAW,YAAY;AAChC;","names":["cache","createCache"]}
1
+ {"version":3,"sources":["../../../src/next/root-style-registry.tsx"],"sourcesContent":["'use client'\n\nimport createCache, { EmotionCache } from '@emotion/cache'\nimport { cache } from '@emotion/css'\nimport { useServerInsertedHTML } from 'next/navigation'\nimport { ReactNode, createContext, useContext, useState } from 'react'\n\nconst CacheContext = createContext(cache)\n\nconst createRootStyleCache = ({ key }: { key: string }) => {\n const cache = createCache({ key })\n cache.compat = true\n\n const prevInsert = cache.insert\n let inserted: string[] = []\n\n cache.insert = (...args) => {\n const serialized = args[1]\n if (cache.inserted[serialized.name] === undefined) {\n inserted.push(serialized.name)\n }\n return prevInsert(...args)\n }\n\n const flush = () => {\n const prevInserted = inserted\n inserted = []\n return prevInserted\n }\n\n return { cache, flush }\n}\n\nexport function RootStyleRegistry({\n children,\n cacheKey,\n}: {\n children: ReactNode\n cacheKey?: string\n}) {\n const [{ cache, flush }] = useState(() => createRootStyleCache({ key: cacheKey ?? 'mswft' }))\n\n useServerInsertedHTML(() => {\n const names = flush()\n if (names.length === 0) return null\n let styles = ''\n for (const name of names) {\n styles += cache.inserted[name]\n }\n\n return (\n <style\n data-emotion={`${cache.key} ${names.join(' ')}`}\n dangerouslySetInnerHTML={{\n __html: styles,\n }}\n />\n )\n })\n\n return <CacheContext.Provider value={cache}>{children}</CacheContext.Provider>\n}\n\nexport function useCache(): EmotionCache {\n return useContext(CacheContext)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmDM;AAjDN,mBAA0C;AAC1C,iBAAsB;AACtB,wBAAsC;AACtC,mBAA+D;AAE/D,MAAM,mBAAe,4BAAc,gBAAK;AAExC,MAAM,uBAAuB,CAAC,EAAE,IAAI,MAAuB;AACzD,QAAMA,aAAQ,aAAAC,SAAY,EAAE,IAAI,CAAC;AACjC,EAAAD,OAAM,SAAS;AAEf,QAAM,aAAaA,OAAM;AACzB,MAAI,WAAqB,CAAC;AAE1B,EAAAA,OAAM,SAAS,IAAI,SAAS;AAC1B,UAAM,aAAa,KAAK,CAAC;AACzB,QAAIA,OAAM,SAAS,WAAW,IAAI,MAAM,QAAW;AACjD,eAAS,KAAK,WAAW,IAAI;AAAA,IAC/B;AACA,WAAO,WAAW,GAAG,IAAI;AAAA,EAC3B;AAEA,QAAM,QAAQ,MAAM;AAClB,UAAM,eAAe;AACrB,eAAW,CAAC;AACZ,WAAO;AAAA,EACT;AAEA,SAAO,EAAE,OAAAA,QAAO,MAAM;AACxB;AAEO,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AACF,GAGG;AACD,QAAM,CAAC,EAAE,OAAAA,QAAO,MAAM,CAAC,QAAI,uBAAS,MAAM,qBAAqB,EAAE,KAAK,YAAY,QAAQ,CAAC,CAAC;AAE5F,+CAAsB,MAAM;AAC1B,UAAM,QAAQ,MAAM;AACpB,QAAI,MAAM,WAAW;AAAG,aAAO;AAC/B,QAAI,SAAS;AACb,eAAW,QAAQ,OAAO;AACxB,gBAAUA,OAAM,SAAS,IAAI;AAAA,IAC/B;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,gBAAc,GAAGA,OAAM,GAAG,IAAI,MAAM,KAAK,GAAG,CAAC;AAAA,QAC7C,yBAAyB;AAAA,UACvB,QAAQ;AAAA,QACV;AAAA;AAAA,IACF;AAAA,EAEJ,CAAC;AAED,SAAO,4CAAC,aAAa,UAAb,EAAsB,OAAOA,QAAQ,UAAS;AACxD;AAEO,SAAS,WAAyB;AACvC,aAAO,yBAAW,YAAY;AAChC;","names":["cache","createCache"]}
@@ -14,7 +14,7 @@ async function handler(...args) {
14
14
  const supportsDraftMode = match(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
15
15
  const supportsWebhook = match(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
16
16
  const body = {
17
- version: "0.23.9",
17
+ version: "0.23.10",
18
18
  previewMode: supportsPreviewMode,
19
19
  draftMode: supportsDraftMode,
20
20
  interactionMode: true,
@@ -5,8 +5,8 @@ import { cache } from "@emotion/css";
5
5
  import { useServerInsertedHTML } from "next/navigation";
6
6
  import { createContext, useContext, useState } from "react";
7
7
  const CacheContext = createContext(cache);
8
- const createRootStyleCache = () => {
9
- const cache2 = createCache({ key: "css" });
8
+ const createRootStyleCache = ({ key }) => {
9
+ const cache2 = createCache({ key });
10
10
  cache2.compat = true;
11
11
  const prevInsert = cache2.insert;
12
12
  let inserted = [];
@@ -24,8 +24,11 @@ const createRootStyleCache = () => {
24
24
  };
25
25
  return { cache: cache2, flush };
26
26
  };
27
- function RootStyleRegistry({ children }) {
28
- const [{ cache: cache2, flush }] = useState(() => createRootStyleCache());
27
+ function RootStyleRegistry({
28
+ children,
29
+ cacheKey
30
+ }) {
31
+ const [{ cache: cache2, flush }] = useState(() => createRootStyleCache({ key: cacheKey ?? "mswft" }));
29
32
  useServerInsertedHTML(() => {
30
33
  const names = flush();
31
34
  if (names.length === 0)
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/next/root-style-registry.tsx"],"sourcesContent":["'use client'\n\nimport createCache, { EmotionCache } from '@emotion/cache'\nimport { cache } from '@emotion/css'\nimport { useServerInsertedHTML } from 'next/navigation'\nimport { ReactNode, createContext, useContext, useState } from 'react'\n\nconst CacheContext = createContext(cache)\n\nconst createRootStyleCache = () => {\n const cache = createCache({ key: 'css' })\n cache.compat = true\n\n const prevInsert = cache.insert\n let inserted: string[] = []\n\n cache.insert = (...args) => {\n const serialized = args[1]\n if (cache.inserted[serialized.name] === undefined) {\n inserted.push(serialized.name)\n }\n return prevInsert(...args)\n }\n\n const flush = () => {\n const prevInserted = inserted\n inserted = []\n return prevInserted\n }\n\n return { cache, flush }\n}\n\nexport function RootStyleRegistry({ children }: { children: ReactNode }) {\n const [{ cache, flush }] = useState(() => createRootStyleCache())\n\n useServerInsertedHTML(() => {\n const names = flush()\n if (names.length === 0) return null\n let styles = ''\n for (const name of names) {\n styles += cache.inserted[name]\n }\n\n return (\n <style\n data-emotion={`${cache.key} ${names.join(' ')}`}\n dangerouslySetInnerHTML={{\n __html: styles,\n }}\n />\n )\n })\n\n return <CacheContext.Provider value={cache}>{children}</CacheContext.Provider>\n}\n\nexport function useCache(): EmotionCache {\n return useContext(CacheContext)\n}\n"],"mappings":";AA6CM;AA3CN,OAAO,iBAAmC;AAC1C,SAAS,aAAa;AACtB,SAAS,6BAA6B;AACtC,SAAoB,eAAe,YAAY,gBAAgB;AAE/D,MAAM,eAAe,cAAc,KAAK;AAExC,MAAM,uBAAuB,MAAM;AACjC,QAAMA,SAAQ,YAAY,EAAE,KAAK,MAAM,CAAC;AACxC,EAAAA,OAAM,SAAS;AAEf,QAAM,aAAaA,OAAM;AACzB,MAAI,WAAqB,CAAC;AAE1B,EAAAA,OAAM,SAAS,IAAI,SAAS;AAC1B,UAAM,aAAa,KAAK,CAAC;AACzB,QAAIA,OAAM,SAAS,WAAW,IAAI,MAAM,QAAW;AACjD,eAAS,KAAK,WAAW,IAAI;AAAA,IAC/B;AACA,WAAO,WAAW,GAAG,IAAI;AAAA,EAC3B;AAEA,QAAM,QAAQ,MAAM;AAClB,UAAM,eAAe;AACrB,eAAW,CAAC;AACZ,WAAO;AAAA,EACT;AAEA,SAAO,EAAE,OAAAA,QAAO,MAAM;AACxB;AAEO,SAAS,kBAAkB,EAAE,SAAS,GAA4B;AACvE,QAAM,CAAC,EAAE,OAAAA,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,qBAAqB,CAAC;AAEhE,wBAAsB,MAAM;AAC1B,UAAM,QAAQ,MAAM;AACpB,QAAI,MAAM,WAAW;AAAG,aAAO;AAC/B,QAAI,SAAS;AACb,eAAW,QAAQ,OAAO;AACxB,gBAAUA,OAAM,SAAS,IAAI;AAAA,IAC/B;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,gBAAc,GAAGA,OAAM,GAAG,IAAI,MAAM,KAAK,GAAG,CAAC;AAAA,QAC7C,yBAAyB;AAAA,UACvB,QAAQ;AAAA,QACV;AAAA;AAAA,IACF;AAAA,EAEJ,CAAC;AAED,SAAO,oBAAC,aAAa,UAAb,EAAsB,OAAOA,QAAQ,UAAS;AACxD;AAEO,SAAS,WAAyB;AACvC,SAAO,WAAW,YAAY;AAChC;","names":["cache"]}
1
+ {"version":3,"sources":["../../../src/next/root-style-registry.tsx"],"sourcesContent":["'use client'\n\nimport createCache, { EmotionCache } from '@emotion/cache'\nimport { cache } from '@emotion/css'\nimport { useServerInsertedHTML } from 'next/navigation'\nimport { ReactNode, createContext, useContext, useState } from 'react'\n\nconst CacheContext = createContext(cache)\n\nconst createRootStyleCache = ({ key }: { key: string }) => {\n const cache = createCache({ key })\n cache.compat = true\n\n const prevInsert = cache.insert\n let inserted: string[] = []\n\n cache.insert = (...args) => {\n const serialized = args[1]\n if (cache.inserted[serialized.name] === undefined) {\n inserted.push(serialized.name)\n }\n return prevInsert(...args)\n }\n\n const flush = () => {\n const prevInserted = inserted\n inserted = []\n return prevInserted\n }\n\n return { cache, flush }\n}\n\nexport function RootStyleRegistry({\n children,\n cacheKey,\n}: {\n children: ReactNode\n cacheKey?: string\n}) {\n const [{ cache, flush }] = useState(() => createRootStyleCache({ key: cacheKey ?? 'mswft' }))\n\n useServerInsertedHTML(() => {\n const names = flush()\n if (names.length === 0) return null\n let styles = ''\n for (const name of names) {\n styles += cache.inserted[name]\n }\n\n return (\n <style\n data-emotion={`${cache.key} ${names.join(' ')}`}\n dangerouslySetInnerHTML={{\n __html: styles,\n }}\n />\n )\n })\n\n return <CacheContext.Provider value={cache}>{children}</CacheContext.Provider>\n}\n\nexport function useCache(): EmotionCache {\n return useContext(CacheContext)\n}\n"],"mappings":";AAmDM;AAjDN,OAAO,iBAAmC;AAC1C,SAAS,aAAa;AACtB,SAAS,6BAA6B;AACtC,SAAoB,eAAe,YAAY,gBAAgB;AAE/D,MAAM,eAAe,cAAc,KAAK;AAExC,MAAM,uBAAuB,CAAC,EAAE,IAAI,MAAuB;AACzD,QAAMA,SAAQ,YAAY,EAAE,IAAI,CAAC;AACjC,EAAAA,OAAM,SAAS;AAEf,QAAM,aAAaA,OAAM;AACzB,MAAI,WAAqB,CAAC;AAE1B,EAAAA,OAAM,SAAS,IAAI,SAAS;AAC1B,UAAM,aAAa,KAAK,CAAC;AACzB,QAAIA,OAAM,SAAS,WAAW,IAAI,MAAM,QAAW;AACjD,eAAS,KAAK,WAAW,IAAI;AAAA,IAC/B;AACA,WAAO,WAAW,GAAG,IAAI;AAAA,EAC3B;AAEA,QAAM,QAAQ,MAAM;AAClB,UAAM,eAAe;AACrB,eAAW,CAAC;AACZ,WAAO;AAAA,EACT;AAEA,SAAO,EAAE,OAAAA,QAAO,MAAM;AACxB;AAEO,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AACF,GAGG;AACD,QAAM,CAAC,EAAE,OAAAA,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,qBAAqB,EAAE,KAAK,YAAY,QAAQ,CAAC,CAAC;AAE5F,wBAAsB,MAAM;AAC1B,UAAM,QAAQ,MAAM;AACpB,QAAI,MAAM,WAAW;AAAG,aAAO;AAC/B,QAAI,SAAS;AACb,eAAW,QAAQ,OAAO;AACxB,gBAAUA,OAAM,SAAS,IAAI;AAAA,IAC/B;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,gBAAc,GAAGA,OAAM,GAAG,IAAI,MAAM,KAAK,GAAG,CAAC;AAAA,QAC7C,yBAAyB;AAAA,UACvB,QAAQ;AAAA,QACV;AAAA;AAAA,IACF;AAAA,EAEJ,CAAC;AAED,SAAO,oBAAC,aAAa,UAAb,EAAsB,OAAOA,QAAQ,UAAS;AACxD;AAEO,SAAS,WAAyB;AACvC,SAAO,WAAW,YAAY;AAChC;","names":["cache"]}
@@ -1,7 +1,8 @@
1
1
  import { EmotionCache } from '@emotion/cache';
2
2
  import { ReactNode } from 'react';
3
- export declare function RootStyleRegistry({ children }: {
3
+ export declare function RootStyleRegistry({ children, cacheKey, }: {
4
4
  children: ReactNode;
5
+ cacheKey?: string;
5
6
  }): import("react/jsx-runtime").JSX.Element;
6
7
  export declare function useCache(): EmotionCache;
7
8
  //# sourceMappingURL=root-style-registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"root-style-registry.d.ts","sourceRoot":"","sources":["../../../src/next/root-style-registry.tsx"],"names":[],"mappings":"AAEA,OAAoB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAG1D,OAAO,EAAE,SAAS,EAAuC,MAAM,OAAO,CAAA;AA4BtE,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAsBtE;AAED,wBAAgB,QAAQ,IAAI,YAAY,CAEvC"}
1
+ {"version":3,"file":"root-style-registry.d.ts","sourceRoot":"","sources":["../../../src/next/root-style-registry.tsx"],"names":[],"mappings":"AAEA,OAAoB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAG1D,OAAO,EAAE,SAAS,EAAuC,MAAM,OAAO,CAAA;AA4BtE,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,2CAsBA;AAED,wBAAgB,QAAQ,IAAI,YAAY,CAEvC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makeswift/runtime",
3
- "version": "0.23.9",
3
+ "version": "0.23.10",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist",
@@ -164,8 +164,8 @@
164
164
  "uuid": "^9.0.0",
165
165
  "zod": "^3.21.4",
166
166
  "@makeswift/controls": "0.1.8",
167
- "@makeswift/prop-controllers": "0.4.1",
168
- "@makeswift/next-plugin": "0.3.1"
167
+ "@makeswift/next-plugin": "0.3.1",
168
+ "@makeswift/prop-controllers": "0.4.1"
169
169
  },
170
170
  "devDependencies": {
171
171
  "@emotion/jest": "^11.11.0",