@knapsack/types 4.69.9--canary.32dcae2.0 → 4.69.9
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.
- package/CHANGELOG.md +18 -0
- package/dist/acd-test-fixtures/index.js +2 -0
- package/dist/acd-test-fixtures/index.js.map +1 -1
- package/dist/acd-test-fixtures/index.mjs +2 -0
- package/dist/acd-test-fixtures/index.mjs.map +1 -1
- package/dist/acd-test-fixtures/ks-sandbox.d.ts.map +1 -1
- package/dist/design-src.types.d.ts +1 -1
- package/dist/design-src.types.d.ts.map +1 -1
- package/dist/index.js +3 -77
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -73
- package/dist/index.mjs.map +1 -1
- package/dist/renderer-client-types.d.ts +9 -0
- package/dist/renderer-client-types.d.ts.map +1 -1
- package/dist/renderers.d.ts +0 -105
- package/dist/renderers.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ks-sandbox.d.ts","sourceRoot":"","sources":["../../src/acd-test-fixtures/ks-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,eAAO,MAAM,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"ks-sandbox.d.ts","sourceRoot":"","sources":["../../src/acd-test-fixtures/ks-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,eAAO,MAAM,SAAS,EAAE,qBA4/TvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design-src.types.d.ts","sourceRoot":"","sources":["../src/design-src.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,
|
|
1
|
+
{"version":3,"file":"design-src.types.d.ts","sourceRoot":"","sources":["../src/design-src.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,KAAK,GAAG,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;IACxC,QAAQ,EAAE,qBAAqB,EAAE,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
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,
|