@knapsack/types 4.69.9--canary.4739.3a8c6f1.0 → 4.69.9--canary.4768.997c53b.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -88,7 +88,6 @@ __export(src_exports, {
88
88
  WS_EVENTS: () => WS_EVENTS,
89
89
  assertTokenData: () => assertTokenData,
90
90
  customizableNavElements: () => customizableNavElements,
91
- getKsRendererClientGlobal: () => getKsRendererClientGlobal,
92
91
  getPrimitiveValue: () => getPrimitiveValue,
93
92
  hasTokenReferences: () => hasTokenReferences,
94
93
  isArrayOfObjectsProp: () => isArrayOfObjectsProp,
@@ -102,13 +101,10 @@ __export(src_exports, {
102
101
  isKsAppClientDataAndMetaV3: () => isKsAppClientDataAndMetaV3,
103
102
  isKsAppClientDataNoMeta: () => isKsAppClientDataNoMeta,
104
103
  isKsAppClientDataNoMetaV3: () => isKsAppClientDataNoMetaV3,
105
- isKsJsImports: () => isKsJsImports,
106
104
  isKsMetaState: () => isKsMetaState,
107
105
  isKsMetaStateV3: () => isKsMetaStateV3,
108
106
  isKsRemoteChange: () => isKsRemoteChange,
109
107
  isKsRemoteChanges: () => isKsRemoteChanges,
110
- isKsRendererClientGlobal: () => isKsRendererClientGlobal,
111
- isKsRendererClientGlobalImportedModules: () => isKsRendererClientGlobalImportedModules,
112
108
  isNotTokenReference: () => isNotTokenReference,
113
109
  isNumberProp: () => isNumberProp,
114
110
  isObjKey: () => import_utils.isObjKey,
@@ -139,6 +135,7 @@ __export(src_exports, {
139
135
  isTokenValueFontWeight: () => isTokenValueFontWeight,
140
136
  isTokenValueShadow: () => isTokenValueShadow,
141
137
  isTokenValueTransition: () => isTokenValueTransition,
138
+ ksRendererClientMetaId: () => ksRendererClientMetaId,
142
139
  migrations: () => migrations,
143
140
  pageElements: () => pageElements,
144
141
  pageElementsV2: () => pageElementsV2,
@@ -1760,81 +1757,13 @@ var rendererIds = {
1760
1757
  angular: "angular",
1761
1758
  html: "html"
1762
1759
  };
1763
- function isKsJsImports(imports) {
1764
- if (!Array.isArray(imports)) return false;
1765
- if (imports.length === 0) return true;
1766
- const [anImport] = imports;
1767
- if (anImport.type === "pattern-template" && typeof anImport.patternId !== "string")
1768
- return false;
1769
- if (anImport.type === "pattern-template-demo" && typeof anImport.patternId !== "string")
1770
- return false;
1771
- if (anImport.type === "pattern-template-demo" && typeof anImport.templateId !== "string")
1772
- return false;
1773
- if (anImport.type === "pattern-template-demo" && typeof anImport.demoId !== "string")
1774
- return false;
1775
- if (anImport.type === "extra" && typeof anImport.importInfo !== "object")
1776
- return false;
1777
- if (anImport.type === "extra" && typeof anImport.importInfo.type !== "string")
1778
- return false;
1779
- if (anImport.type === "extra" && typeof anImport.importInfo.name !== "string")
1780
- return false;
1781
- if (anImport.type === "extra" && typeof anImport.importInfo.path !== "string")
1782
- return false;
1783
- if (anImport.type === "extra" && typeof anImport.importInfo.names !== "undefined") {
1784
- if (!Array.isArray(anImport.importInfo.names)) return false;
1785
- if (anImport.importInfo.names.some((name) => typeof name !== "string"))
1786
- return false;
1787
- }
1788
- return true;
1789
- }
1790
- __name(isKsJsImports, "isKsJsImports");
1791
- function isKsRendererClientGlobalImportedModules(mods) {
1792
- if (!(0, import_utils.isObject)(mods)) return false;
1793
- for (const key in mods) {
1794
- if (typeof mods[key] !== "function") return false;
1795
- }
1796
- return true;
1797
- }
1798
- __name(isKsRendererClientGlobalImportedModules, "isKsRendererClientGlobalImportedModules");
1799
- function isKsRendererClientGlobal(knapsack) {
1800
- if (!(0, import_utils.isObject)(knapsack)) return false;
1801
- if (knapsack.typeName !== "KsRendererClientGlobal") return false;
1802
- if (typeof knapsack.getImport !== "function") return false;
1803
- if (!Array.isArray(knapsack.allAvailableImports)) return false;
1804
- if (!isKsRendererClientGlobalImportedModules(knapsack.importedModules)) {
1805
- return false;
1806
- }
1807
- return isKsJsImports(knapsack.allAvailableImports);
1808
- }
1809
- __name(isKsRendererClientGlobal, "isKsRendererClientGlobal");
1810
- var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
1811
- function getKsRendererClientGlobal() {
1812
- if (!isBrowser) {
1813
- throw new Error(
1814
- "Cannot get KsRendererClientGlobal in a non-browser environment"
1815
- );
1816
- }
1817
- const { knapsack } = window;
1818
- if (!knapsack) {
1819
- throw new Error(
1820
- 'Cannot get KsRendererClientGlobal: "knapsack" is not defined on the window'
1821
- );
1822
- }
1823
- if (!isKsRendererClientGlobal(knapsack)) {
1824
- console.log(`Object found at "window.knapsack":`, knapsack);
1825
- throw new Error(
1826
- `Cannot get KsRendererClientGlobal: knapsack is not the correct type`
1827
- );
1828
- }
1829
- return knapsack;
1830
- }
1831
- __name(getKsRendererClientGlobal, "getKsRendererClientGlobal");
1832
1760
 
1833
1761
  // src/renderer-client-types.ts
1834
1762
  var KsRendererClientEvents = /* @__PURE__ */ ((KsRendererClientEvents2) => {
1835
1763
  KsRendererClientEvents2["ready"] = "ready";
1836
1764
  return KsRendererClientEvents2;
1837
1765
  })(KsRendererClientEvents || {});
1766
+ var ksRendererClientMetaId = "ks-meta";
1838
1767
 
1839
1768
  // src/web-sockets.ts
1840
1769
  var WS_EVENTS = {
@@ -1967,7 +1896,6 @@ var roles = Object.values(rolesById);
1967
1896
  WS_EVENTS,
1968
1897
  assertTokenData,
1969
1898
  customizableNavElements,
1970
- getKsRendererClientGlobal,
1971
1899
  getPrimitiveValue,
1972
1900
  hasTokenReferences,
1973
1901
  isArrayOfObjectsProp,
@@ -1981,13 +1909,10 @@ var roles = Object.values(rolesById);
1981
1909
  isKsAppClientDataAndMetaV3,
1982
1910
  isKsAppClientDataNoMeta,
1983
1911
  isKsAppClientDataNoMetaV3,
1984
- isKsJsImports,
1985
1912
  isKsMetaState,
1986
1913
  isKsMetaStateV3,
1987
1914
  isKsRemoteChange,
1988
1915
  isKsRemoteChanges,
1989
- isKsRendererClientGlobal,
1990
- isKsRendererClientGlobalImportedModules,
1991
1916
  isNotTokenReference,
1992
1917
  isNumberProp,
1993
1918
  isObjKey,
@@ -2018,6 +1943,7 @@ var roles = Object.values(rolesById);
2018
1943
  isTokenValueFontWeight,
2019
1944
  isTokenValueShadow,
2020
1945
  isTokenValueTransition,
1946
+ ksRendererClientMetaId,
2021
1947
  migrations,
2022
1948
  pageElements,
2023
1949
  pageElementsV2,