@blockbite/shared-utils 2.0.1 → 2.0.3
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/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/tailwind-editor-config.js +0 -1
- package/dist/cjs/tailwind-editor-config.js.map +1 -1
- package/dist/cjs/vite-globals.js +38 -0
- package/dist/cjs/vite-globals.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/tailwind-editor-config.d.ts +0 -1
- package/dist/tailwind-editor-config.js +0 -1
- package/dist/tailwind-editor-config.js.map +1 -1
- package/dist/vite-globals.d.ts +27 -0
- package/dist/vite-globals.js +39 -0
- package/dist/vite-globals.js.map +1 -0
- package/package.json +1 -1
- package/dist/cjs/shared-types.js +0 -2
- package/dist/cjs/shared-types.js.map +0 -1
- package/dist/shared-types.d.ts +0 -61
- package/dist/shared-types.js +0 -2
- package/dist/shared-types.js.map +0 -1
package/dist/cjs/index.js
CHANGED
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind-editor-config.js","sourceRoot":"","sources":["../../src/tailwind-editor-config.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,
|
|
1
|
+
{"version":3,"file":"tailwind-editor-config.js","sourceRoot":"","sources":["../../src/tailwind-editor-config.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,OAAO,EAAE,CAAC,4BAA4B,CAAC;IACvC,QAAQ,EAAE;QACR,YAAY;QACZ,aAAa;QACb,aAAa;QACb,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,cAAc;QACd,YAAY;QACZ,UAAU;QACV,UAAU;QACV,UAAU;QACV,UAAU;QACV,UAAU;QACV,UAAU;QACV,UAAU;QACV,UAAU;QACV,UAAU;KACX;IACD,OAAO,EAAE,EAAE;IACX,KAAK,EAAE;QACL,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,qHAAqH;gBACrH,YAAY;aACb;SACF;QACD,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,SAAS,EAAE,6BAA6B;gBACxC,YAAY,EAAE,gDAAgD;gBAC9D,QAAQ,EACN,yEAAyE;gBAC3E,IAAI,EAAE,oBAAoB;gBAC1B,KAAK,EAAE,SAAS;gBAChB,MAAM,EAAE,SAAS;gBACjB,MAAM,EAAE,SAAS;gBACjB,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,SAAS;aACpB;YACD,eAAe,EAAE;gBACf,gBAAgB,EAAE,oDAAoD;aACvE;YACD,WAAW,EAAE;gBACX,KAAK,EAAE,OAAO;gBACd,MAAM,EAAE,QAAQ;gBAChB,MAAM,EAAE,QAAQ;gBAChB,KAAK,EAAE,OAAO;gBACd,KAAK,EAAE,OAAO;gBACd,KAAK,EAAE,OAAO;gBACd,OAAO,EAAE,SAAS;gBAClB,KAAK,EAAE,OAAO;aACf;YACD,KAAK,EAAE;gBACL,EAAE,EAAE,KAAK;gBACT,EAAE,EAAE,KAAK;gBACT,EAAE,EAAE,KAAK;gBACT,EAAE,EAAE,KAAK;gBACT,EAAE,EAAE,KAAK;gBACT,EAAE,EAAE,KAAK;gBACT,EAAE,EAAE,KAAK;gBACT,EAAE,EAAE,KAAK;gBACT,EAAE,EAAE,KAAK;aACV;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export function viteWpGlobals(extendGlobals = {}) {
|
|
2
|
+
const externalGlobals = {
|
|
3
|
+
'@wordpress/blocks': 'wp.blocks',
|
|
4
|
+
'@wordpress/i18n': 'wp.i18n',
|
|
5
|
+
'@wordpress/element': 'wp.element',
|
|
6
|
+
'@wordpress/components': 'wp.components',
|
|
7
|
+
'@wordpress/block-editor': 'wp.blockEditor',
|
|
8
|
+
'@wordpress/edit-post': 'wp.editPost',
|
|
9
|
+
'@wordpress/api-fetch': 'wp.apiFetch',
|
|
10
|
+
'@wordpress/data': 'wp.data',
|
|
11
|
+
'@wordpress/hooks': 'wp.hooks',
|
|
12
|
+
'@wordpress/compose': 'wp.compose',
|
|
13
|
+
'@wordpress/primitives': 'wp.primitives',
|
|
14
|
+
react: 'React',
|
|
15
|
+
'react-dom': 'ReactDOM',
|
|
16
|
+
'react/jsx-runtime': 'ReactJSXRuntime',
|
|
17
|
+
'lottie-web': 'lottie',
|
|
18
|
+
html2canvas: 'html2canvas',
|
|
19
|
+
'/^zustand(\/.*)?$/': 'zustand',
|
|
20
|
+
'@wordpress/plugins': 'wp.plugins',
|
|
21
|
+
'@wordpress/keyboard-shortcuts': 'wp.keyboardShortcuts',
|
|
22
|
+
};
|
|
23
|
+
const externalGlobalsWithExtend = {
|
|
24
|
+
...externalGlobals,
|
|
25
|
+
...extendGlobals,
|
|
26
|
+
};
|
|
27
|
+
const externalWindowGlobals = Object.fromEntries(Object.entries(externalGlobalsWithExtend).map(([key, value]) => [
|
|
28
|
+
key,
|
|
29
|
+
value.startsWith('window.') ? value : `window.${value}`,
|
|
30
|
+
]));
|
|
31
|
+
const externalKeys = Object.keys(externalGlobalsWithExtend);
|
|
32
|
+
return {
|
|
33
|
+
externalGlobals,
|
|
34
|
+
externalWindowGlobals,
|
|
35
|
+
externalKeys,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=vite-globals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-globals.js","sourceRoot":"","sources":["../../src/vite-globals.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa,CAAC,aAAa,GAAG,EAAE;IAE9C,MAAM,eAAe,GAAG;QACtB,mBAAmB,EAAE,WAAW;QAChC,iBAAiB,EAAE,SAAS;QAC5B,oBAAoB,EAAE,YAAY;QAClC,uBAAuB,EAAE,eAAe;QACxC,yBAAyB,EAAE,gBAAgB;QAC3C,sBAAsB,EAAE,aAAa;QACrC,sBAAsB,EAAE,aAAa;QACrC,iBAAiB,EAAE,SAAS;QAC5B,kBAAkB,EAAE,UAAU;QAC9B,oBAAoB,EAAE,YAAY;QAClC,uBAAuB,EAAE,eAAe;QACxC,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,UAAU;QACvB,mBAAmB,EAAE,iBAAiB;QACtC,YAAY,EAAE,QAAQ;QACtB,WAAW,EAAE,aAAa;QAC1B,oBAAoB,EAAE,SAAS;QAC/B,oBAAoB,EAAE,YAAY;QAClC,+BAA+B,EAAE,sBAAsB;KACxD,CAAC;IAEF,MAAM,yBAAyB,GAAG;QAChC,GAAG,eAAe;QAClB,GAAG,aAAa;KACjB,CAAC;IAEF,MAAM,qBAAqB,GAAG,MAAM,CAAC,WAAW,CAC9C,MAAM,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;QAC9D,GAAG;QACH,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,KAAK,EAAE;KACxD,CAAC,CACH,CAAC;IAEF,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IAE5D,OAAO;QACL,eAAe;QACf,qBAAqB;QACrB,YAAY;KACb,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind-editor-config.js","sourceRoot":"","sources":["../src/tailwind-editor-config.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,
|
|
1
|
+
{"version":3,"file":"tailwind-editor-config.js","sourceRoot":"","sources":["../src/tailwind-editor-config.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,OAAO,EAAE,CAAC,4BAA4B,CAAC;IACvC,QAAQ,EAAE;QACR,YAAY;QACZ,aAAa;QACb,aAAa;QACb,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,cAAc;QACd,YAAY;QACZ,UAAU;QACV,UAAU;QACV,UAAU;QACV,UAAU;QACV,UAAU;QACV,UAAU;QACV,UAAU;QACV,UAAU;QACV,UAAU;KACX;IACD,OAAO,EAAE,EAAE;IACX,KAAK,EAAE;QACL,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,qHAAqH;gBACrH,YAAY;aACb;SACF;QACD,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,SAAS,EAAE,6BAA6B;gBACxC,YAAY,EAAE,gDAAgD;gBAC9D,QAAQ,EACN,yEAAyE;gBAC3E,IAAI,EAAE,oBAAoB;gBAC1B,KAAK,EAAE,SAAS;gBAChB,MAAM,EAAE,SAAS;gBACjB,MAAM,EAAE,SAAS;gBACjB,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,SAAS;aACpB;YACD,eAAe,EAAE;gBACf,gBAAgB,EAAE,oDAAoD;aACvE;YACD,WAAW,EAAE;gBACX,KAAK,EAAE,OAAO;gBACd,MAAM,EAAE,QAAQ;gBAChB,MAAM,EAAE,QAAQ;gBAChB,KAAK,EAAE,OAAO;gBACd,KAAK,EAAE,OAAO;gBACd,KAAK,EAAE,OAAO;gBACd,OAAO,EAAE,SAAS;gBAClB,KAAK,EAAE,OAAO;aACf;YACD,KAAK,EAAE;gBACL,EAAE,EAAE,KAAK;gBACT,EAAE,EAAE,KAAK;gBACT,EAAE,EAAE,KAAK;gBACT,EAAE,EAAE,KAAK;gBACT,EAAE,EAAE,KAAK;gBACT,EAAE,EAAE,KAAK;gBACT,EAAE,EAAE,KAAK;gBACT,EAAE,EAAE,KAAK;gBACT,EAAE,EAAE,KAAK;aACV;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare function viteWpGlobals(extendGlobals?: {}): {
|
|
2
|
+
externalGlobals: {
|
|
3
|
+
'@wordpress/blocks': string;
|
|
4
|
+
'@wordpress/i18n': string;
|
|
5
|
+
'@wordpress/element': string;
|
|
6
|
+
'@wordpress/components': string;
|
|
7
|
+
'@wordpress/block-editor': string;
|
|
8
|
+
'@wordpress/edit-post': string;
|
|
9
|
+
'@wordpress/api-fetch': string;
|
|
10
|
+
'@wordpress/data': string;
|
|
11
|
+
'@wordpress/hooks': string;
|
|
12
|
+
'@wordpress/compose': string;
|
|
13
|
+
'@wordpress/primitives': string;
|
|
14
|
+
react: string;
|
|
15
|
+
'react-dom': string;
|
|
16
|
+
'react/jsx-runtime': string;
|
|
17
|
+
'lottie-web': string;
|
|
18
|
+
html2canvas: string;
|
|
19
|
+
'/^zustand(/.*)?$/': string;
|
|
20
|
+
'@wordpress/plugins': string;
|
|
21
|
+
'@wordpress/keyboard-shortcuts': string;
|
|
22
|
+
};
|
|
23
|
+
externalWindowGlobals: {
|
|
24
|
+
[k: string]: string;
|
|
25
|
+
};
|
|
26
|
+
externalKeys: string[];
|
|
27
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export function viteWpGlobals(extendGlobals = {}) {
|
|
2
|
+
// External globals for WordPress and React
|
|
3
|
+
const externalGlobals = {
|
|
4
|
+
'@wordpress/blocks': 'wp.blocks',
|
|
5
|
+
'@wordpress/i18n': 'wp.i18n',
|
|
6
|
+
'@wordpress/element': 'wp.element',
|
|
7
|
+
'@wordpress/components': 'wp.components',
|
|
8
|
+
'@wordpress/block-editor': 'wp.blockEditor',
|
|
9
|
+
'@wordpress/edit-post': 'wp.editPost',
|
|
10
|
+
'@wordpress/api-fetch': 'wp.apiFetch',
|
|
11
|
+
'@wordpress/data': 'wp.data',
|
|
12
|
+
'@wordpress/hooks': 'wp.hooks',
|
|
13
|
+
'@wordpress/compose': 'wp.compose',
|
|
14
|
+
'@wordpress/primitives': 'wp.primitives',
|
|
15
|
+
react: 'React',
|
|
16
|
+
'react-dom': 'ReactDOM',
|
|
17
|
+
'react/jsx-runtime': 'ReactJSXRuntime',
|
|
18
|
+
'lottie-web': 'lottie',
|
|
19
|
+
html2canvas: 'html2canvas',
|
|
20
|
+
'/^zustand(\/.*)?$/': 'zustand',
|
|
21
|
+
'@wordpress/plugins': 'wp.plugins',
|
|
22
|
+
'@wordpress/keyboard-shortcuts': 'wp.keyboardShortcuts',
|
|
23
|
+
};
|
|
24
|
+
const externalGlobalsWithExtend = {
|
|
25
|
+
...externalGlobals,
|
|
26
|
+
...extendGlobals,
|
|
27
|
+
};
|
|
28
|
+
const externalWindowGlobals = Object.fromEntries(Object.entries(externalGlobalsWithExtend).map(([key, value]) => [
|
|
29
|
+
key,
|
|
30
|
+
value.startsWith('window.') ? value : `window.${value}`,
|
|
31
|
+
]));
|
|
32
|
+
const externalKeys = Object.keys(externalGlobalsWithExtend);
|
|
33
|
+
return {
|
|
34
|
+
externalGlobals,
|
|
35
|
+
externalWindowGlobals,
|
|
36
|
+
externalKeys,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=vite-globals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-globals.js","sourceRoot":"","sources":["../src/vite-globals.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa,CAAC,aAAa,GAAG,EAAE;IAC9C,2CAA2C;IAC3C,MAAM,eAAe,GAAG;QACtB,mBAAmB,EAAE,WAAW;QAChC,iBAAiB,EAAE,SAAS;QAC5B,oBAAoB,EAAE,YAAY;QAClC,uBAAuB,EAAE,eAAe;QACxC,yBAAyB,EAAE,gBAAgB;QAC3C,sBAAsB,EAAE,aAAa;QACrC,sBAAsB,EAAE,aAAa;QACrC,iBAAiB,EAAE,SAAS;QAC5B,kBAAkB,EAAE,UAAU;QAC9B,oBAAoB,EAAE,YAAY;QAClC,uBAAuB,EAAE,eAAe;QACxC,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,UAAU;QACvB,mBAAmB,EAAE,iBAAiB;QACtC,YAAY,EAAE,QAAQ;QACtB,WAAW,EAAE,aAAa;QAC1B,oBAAoB,EAAE,SAAS;QAC/B,oBAAoB,EAAE,YAAY;QAClC,+BAA+B,EAAE,sBAAsB;KACxD,CAAC;IAEF,MAAM,yBAAyB,GAAG;QAChC,GAAG,eAAe;QAClB,GAAG,aAAa;KACjB,CAAC;IAEF,MAAM,qBAAqB,GAAG,MAAM,CAAC,WAAW,CAC9C,MAAM,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;QAC9D,GAAG;QACH,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,KAAK,EAAE;KACxD,CAAC,CACH,CAAC;IAEF,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IAE5D,OAAO;QACL,eAAe;QACf,qBAAqB;QACrB,YAAY;KACb,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
package/dist/cjs/shared-types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared-types.js","sourceRoot":"","sources":["../../src/shared-types.ts"],"names":[],"mappings":""}
|
package/dist/shared-types.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export type bb = {
|
|
2
|
-
apiUrl: string;
|
|
3
|
-
publicUrl: string;
|
|
4
|
-
siteUrl: string;
|
|
5
|
-
api: string;
|
|
6
|
-
data: {
|
|
7
|
-
postType: string;
|
|
8
|
-
id: number | string;
|
|
9
|
-
frontendcss: {
|
|
10
|
-
tailwind: string;
|
|
11
|
-
bites: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
codex: any;
|
|
15
|
-
settings: {
|
|
16
|
-
gsap: boolean;
|
|
17
|
-
lottie: boolean;
|
|
18
|
-
swiper: boolean;
|
|
19
|
-
tw_base: boolean;
|
|
20
|
-
tw_strategy: string;
|
|
21
|
-
tw_prefix: string;
|
|
22
|
-
blockbite_account_token: string;
|
|
23
|
-
blockbite_project_token: string;
|
|
24
|
-
};
|
|
25
|
-
saving: boolean;
|
|
26
|
-
core: {
|
|
27
|
-
getDeviceType: () => string;
|
|
28
|
-
getPostType: () => string;
|
|
29
|
-
getTemplateData: () => Promise<{
|
|
30
|
-
id: number | string;
|
|
31
|
-
postType: string;
|
|
32
|
-
templateType: string;
|
|
33
|
-
templateRef?: string | number;
|
|
34
|
-
}>;
|
|
35
|
-
getSaveState: () => boolean;
|
|
36
|
-
getNativeTheme: (globalStyles: any) => {
|
|
37
|
-
colors: any[];
|
|
38
|
-
fonts: any[];
|
|
39
|
-
fontSizes: any[];
|
|
40
|
-
headings: any[];
|
|
41
|
-
};
|
|
42
|
-
getHeadings: () => any[];
|
|
43
|
-
getEditorType: () => string;
|
|
44
|
-
getEditorMode: () => string;
|
|
45
|
-
updateBlockAttributes: (clientId: string, newAttributes: any) => void;
|
|
46
|
-
selectBlock: (clientId: string) => void;
|
|
47
|
-
getParentBlock: () => any;
|
|
48
|
-
addBodyClass: (className: string) => void;
|
|
49
|
-
getProPlugin: (pluginName: string) => any;
|
|
50
|
-
getBlock: (clientId: string) => any;
|
|
51
|
-
updateEditorCss: (css: string, utilsContent: any) => Promise<void>;
|
|
52
|
-
};
|
|
53
|
-
AceEditor: any;
|
|
54
|
-
editorTwConfig: any;
|
|
55
|
-
editorCssCache: string;
|
|
56
|
-
css: {
|
|
57
|
-
editorCssCache: string;
|
|
58
|
-
editorTwConfig: any;
|
|
59
|
-
};
|
|
60
|
-
html2canvas: any;
|
|
61
|
-
};
|
package/dist/shared-types.js
DELETED
package/dist/shared-types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared-types.js","sourceRoot":"","sources":["../src/shared-types.ts"],"names":[],"mappings":""}
|