@bagelink/blox 1.18.3 → 1.18.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.
- package/dist/{PreviewApp-BKrLRDBC.js → PreviewApp-9H9-jLVN.js} +1 -1
- package/dist/{PreviewApp-Kb3uTwtH.cjs → PreviewApp-D8ZBTG0j.cjs} +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-AC3W0NSJ.cjs → PreviewApp.vue_vue_type_style_index_0_lang-BYCayJs0.cjs} +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-BMGv1eSR.js → PreviewApp.vue_vue_type_style_index_0_lang-BwiLyRBw.js} +1 -1
- package/dist/{appRuntime-CWlPH_5r.js → appRuntime-DZSCSsnS.js} +39 -156
- package/dist/{appRuntime-BU2Ls-Y7.cjs → appRuntime-Z0AxTPxf.cjs} +17 -134
- package/dist/composables/useLocale.d.ts +3 -0
- package/dist/composables/useLocale.d.ts.map +1 -1
- package/dist/composables/useLocaleNav.d.ts.map +1 -1
- package/dist/createBloxApp.d.ts.map +1 -1
- package/dist/hydration.d.ts +2 -0
- package/dist/hydration.d.ts.map +1 -1
- package/dist/index.cjs +16 -9
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +44 -36
- package/dist/localeStrategy-OwRIn35C.cjs +207 -0
- package/dist/localeStrategy-hXlNof1E.js +208 -0
- package/dist/localeStrategy.d.ts +21 -0
- package/dist/localeStrategy.d.ts.map +1 -1
- package/dist/{shard-runner-zmTY7v3n.cjs → shard-runner-Bz46UqN8.cjs} +16 -7
- package/dist/{shard-runner-yZNy6pQy.js → shard-runner-CoFcUVGe.js} +17 -8
- package/dist/ssg/cli.cjs +10 -2
- package/dist/ssg/cli.mjs +10 -2
- package/dist/ssg/cms-routes.d.ts +7 -0
- package/dist/ssg/cms-routes.d.ts.map +1 -1
- package/dist/ssg/index.cjs +4 -2
- package/dist/ssg/index.mjs +19 -17
- package/dist/ssg/prerender.d.ts +5 -1
- package/dist/ssg/prerender.d.ts.map +1 -1
- package/dist/ssg/render-resolved-page.d.ts +2 -0
- package/dist/ssg/render-resolved-page.d.ts.map +1 -1
- package/dist/ssg/shard-runner.d.ts +3 -0
- package/dist/ssg/shard-runner.d.ts.map +1 -1
- package/dist/ssg/validate-output.d.ts +9 -0
- package/dist/ssg/validate-output.d.ts.map +1 -1
- package/dist/{validate-output-3fNPagvj.js → validate-output-B8pmE7hf.js} +115 -28
- package/dist/{validate-output-CrhXrC1l.cjs → validate-output-CbIQrCwa.cjs} +99 -12
- package/package.json +125 -124
- package/LICENSE +0 -21
- package/dist/pageTitle-B1mtDJKn.js +0 -59
- package/dist/pageTitle-wobGhtiZ.cjs +0 -58
package/package.json
CHANGED
|
@@ -1,125 +1,126 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
2
|
+
"name": "@bagelink/blox",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.18.7",
|
|
5
|
+
"description": "Blox page builder library for drag-and-drop page building and static data management",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Bagel Studio",
|
|
8
|
+
"email": "info@bagelstudio.co.il",
|
|
9
|
+
"url": "https://bagelstudio.co.il"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"homepage": "https://github.com/bageldb/bagelink/tree/master/packages/blox#readme",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/bageldb/bagelink.git",
|
|
16
|
+
"directory": "packages/blox"
|
|
17
|
+
},
|
|
18
|
+
"bugs": "https://github.com/bageldb/bagelink/issues",
|
|
19
|
+
"keywords": [
|
|
20
|
+
"blox",
|
|
21
|
+
"page-builder",
|
|
22
|
+
"preview",
|
|
23
|
+
"external-preview",
|
|
24
|
+
"cms",
|
|
25
|
+
"vue",
|
|
26
|
+
"component-library",
|
|
27
|
+
"drag-and-drop",
|
|
28
|
+
"static-pages"
|
|
29
|
+
],
|
|
30
|
+
"bin": {
|
|
31
|
+
"blox-ssg": "dist/ssg/cli.mjs"
|
|
32
|
+
},
|
|
33
|
+
"sideEffects": [
|
|
34
|
+
"**/*.css",
|
|
35
|
+
"**/*.vue"
|
|
36
|
+
],
|
|
37
|
+
"exports": {
|
|
38
|
+
"./package.json": "./package.json",
|
|
39
|
+
"./vite": {
|
|
40
|
+
"types": "./dist/vite-plugin.d.ts",
|
|
41
|
+
"import": "./dist/vite-plugin.mjs"
|
|
42
|
+
},
|
|
43
|
+
".": {
|
|
44
|
+
"types": "./dist/index.d.ts",
|
|
45
|
+
"require": "./dist/index.cjs",
|
|
46
|
+
"import": "./dist/index.mjs"
|
|
47
|
+
},
|
|
48
|
+
"./ssg": {
|
|
49
|
+
"types": "./dist/ssg/index.d.ts",
|
|
50
|
+
"import": "./dist/ssg/index.mjs"
|
|
51
|
+
},
|
|
52
|
+
"./ssg/client": {
|
|
53
|
+
"types": "./dist/ssg/client.d.ts",
|
|
54
|
+
"import": "./dist/ssg/client.mjs"
|
|
55
|
+
},
|
|
56
|
+
"./ssg/build-grant": {
|
|
57
|
+
"types": "./dist/ssg/build-grant.d.ts",
|
|
58
|
+
"import": "./dist/ssg/build-grant.mjs"
|
|
59
|
+
},
|
|
60
|
+
"./style.css": "./dist/style.css",
|
|
61
|
+
"./dist/style.css": "./dist/style.css"
|
|
62
|
+
},
|
|
63
|
+
"main": "./dist/index.cjs",
|
|
64
|
+
"module": "./dist/index.mjs",
|
|
65
|
+
"types": "./dist/index.d.ts",
|
|
66
|
+
"typesVersions": {
|
|
67
|
+
"*": {
|
|
68
|
+
"*": [
|
|
69
|
+
"./dist/*",
|
|
70
|
+
"./dist/index.d.ts"
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"files": [
|
|
75
|
+
"dist",
|
|
76
|
+
"core",
|
|
77
|
+
"components",
|
|
78
|
+
"config",
|
|
79
|
+
"ssg",
|
|
80
|
+
"utils",
|
|
81
|
+
"views",
|
|
82
|
+
"setup.ts",
|
|
83
|
+
"index.ts",
|
|
84
|
+
"README.md"
|
|
85
|
+
],
|
|
86
|
+
"scripts": {
|
|
87
|
+
"prepublishOnly": "pnpm build",
|
|
88
|
+
"dev": "vite build --watch",
|
|
89
|
+
"build": "vite build",
|
|
90
|
+
"typecheck": "vue-tsc --noEmit"
|
|
91
|
+
},
|
|
92
|
+
"publishConfig": {
|
|
93
|
+
"access": "public"
|
|
94
|
+
},
|
|
95
|
+
"peerDependencies": {
|
|
96
|
+
"@bagelink/vue": "*",
|
|
97
|
+
"happy-dom": ">=14.0.0",
|
|
98
|
+
"vite": ">=5.0.0",
|
|
99
|
+
"vue": "^3.3.0",
|
|
100
|
+
"vue-router": "^4.0.0"
|
|
101
|
+
},
|
|
102
|
+
"peerDependenciesMeta": {
|
|
103
|
+
"happy-dom": {
|
|
104
|
+
"optional": true
|
|
105
|
+
},
|
|
106
|
+
"vite": {
|
|
107
|
+
"optional": true
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"devDependencies": {
|
|
111
|
+
"@vitejs/plugin-vue": "^5.2.4",
|
|
112
|
+
"@vue/tsconfig": "^0.7.0",
|
|
113
|
+
"typescript": "^5.9.3",
|
|
114
|
+
"vite": "^5.4.21",
|
|
115
|
+
"vite-plugin-dts": "^4.5.4",
|
|
116
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
117
|
+
"vitest": "^3.2.7",
|
|
118
|
+
"vue": "^3.5.43",
|
|
119
|
+
"vue-router": "^4.6.4",
|
|
120
|
+
"vue-tsc": "^2.2.12"
|
|
121
|
+
},
|
|
122
|
+
"dependencies": {
|
|
123
|
+
"magic-string": "^0.30.21",
|
|
124
|
+
"pinia": "^3.0.4"
|
|
125
|
+
}
|
|
126
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 Bagel Studio
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
const PREFERRED_CONTEXT_KEYS = ["$page", "$post", "$item", "$article", "$product", "$event", "$author"];
|
|
2
|
-
const TITLE_FIELDS = ["meta_title", "metaTitle", "title", "name", "productName", "displayName"];
|
|
3
|
-
function primaryPageContext(contexts) {
|
|
4
|
-
if (!contexts) return null;
|
|
5
|
-
const keys = [
|
|
6
|
-
...PREFERRED_CONTEXT_KEYS.filter((key) => key in contexts),
|
|
7
|
-
...Object.keys(contexts).filter((key) => key !== "$website" && !PREFERRED_CONTEXT_KEYS.includes(key)).sort()
|
|
8
|
-
];
|
|
9
|
-
for (const key of keys) {
|
|
10
|
-
const ctx = contexts[key];
|
|
11
|
-
if (ctx != null && typeof ctx === "object") return { key, ctx };
|
|
12
|
-
}
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
function contextPageTitle(context) {
|
|
16
|
-
if (!context) return null;
|
|
17
|
-
for (const field of TITLE_FIELDS) {
|
|
18
|
-
const value = context[field];
|
|
19
|
-
if (typeof value === "string" && value.trim()) return value.trim();
|
|
20
|
-
}
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
function siteNameFromContexts(contexts) {
|
|
24
|
-
const website = contexts == null ? void 0 : contexts.$website;
|
|
25
|
-
const seo = website == null ? void 0 : website.seo;
|
|
26
|
-
const siteName = seo && typeof seo === "object" ? seo.site_name : website == null ? void 0 : website.site_name;
|
|
27
|
-
return typeof siteName === "string" && siteName.trim() ? siteName.trim() : null;
|
|
28
|
-
}
|
|
29
|
-
function withSiteName(title, siteName) {
|
|
30
|
-
if (!siteName || title.includes(siteName)) return title;
|
|
31
|
-
return `${title} · ${siteName}`;
|
|
32
|
-
}
|
|
33
|
-
function resolvePageTitle(resolved, options = {}) {
|
|
34
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
35
|
-
const hasBinding = !!((_a = resolved.page) == null ? void 0 : _a.data_bindings) && Object.keys(resolved.page.data_bindings).length > 0;
|
|
36
|
-
const contextTitle = hasBinding ? contextPageTitle((_b = primaryPageContext(resolved.contexts)) == null ? void 0 : _b.ctx) : null;
|
|
37
|
-
const overrideTitle = (_c = options.override) == null ? void 0 : _c.trim();
|
|
38
|
-
if (overrideTitle) return overrideTitle;
|
|
39
|
-
if (contextTitle) return withSiteName(contextTitle, options.siteName);
|
|
40
|
-
if ((_e = (_d = resolved.page) == null ? void 0 : _d.meta_title) == null ? void 0 : _e.trim()) return resolved.page.meta_title.trim();
|
|
41
|
-
if ((_g = (_f = resolved.page) == null ? void 0 : _f.title) == null ? void 0 : _g.trim()) return withSiteName(resolved.page.title.trim(), options.siteName);
|
|
42
|
-
if ((_h = options.defaultTitle) == null ? void 0 : _h.trim()) return options.defaultTitle.trim();
|
|
43
|
-
if (options.siteName) return options.siteName;
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
function preserveCurrentSiteSuffix(title, currentTitle) {
|
|
47
|
-
const separator = " · ";
|
|
48
|
-
const suffixIndex = currentTitle.lastIndexOf(separator);
|
|
49
|
-
if (suffixIndex < 0) return title;
|
|
50
|
-
const siteName = currentTitle.slice(suffixIndex + separator.length).trim();
|
|
51
|
-
return withSiteName(title, siteName);
|
|
52
|
-
}
|
|
53
|
-
export {
|
|
54
|
-
preserveCurrentSiteSuffix as a,
|
|
55
|
-
contextPageTitle as c,
|
|
56
|
-
primaryPageContext as p,
|
|
57
|
-
resolvePageTitle as r,
|
|
58
|
-
siteNameFromContexts as s
|
|
59
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const PREFERRED_CONTEXT_KEYS = ["$page", "$post", "$item", "$article", "$product", "$event", "$author"];
|
|
3
|
-
const TITLE_FIELDS = ["meta_title", "metaTitle", "title", "name", "productName", "displayName"];
|
|
4
|
-
function primaryPageContext(contexts) {
|
|
5
|
-
if (!contexts) return null;
|
|
6
|
-
const keys = [
|
|
7
|
-
...PREFERRED_CONTEXT_KEYS.filter((key) => key in contexts),
|
|
8
|
-
...Object.keys(contexts).filter((key) => key !== "$website" && !PREFERRED_CONTEXT_KEYS.includes(key)).sort()
|
|
9
|
-
];
|
|
10
|
-
for (const key of keys) {
|
|
11
|
-
const ctx = contexts[key];
|
|
12
|
-
if (ctx != null && typeof ctx === "object") return { key, ctx };
|
|
13
|
-
}
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
function contextPageTitle(context) {
|
|
17
|
-
if (!context) return null;
|
|
18
|
-
for (const field of TITLE_FIELDS) {
|
|
19
|
-
const value = context[field];
|
|
20
|
-
if (typeof value === "string" && value.trim()) return value.trim();
|
|
21
|
-
}
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
function siteNameFromContexts(contexts) {
|
|
25
|
-
const website = contexts == null ? void 0 : contexts.$website;
|
|
26
|
-
const seo = website == null ? void 0 : website.seo;
|
|
27
|
-
const siteName = seo && typeof seo === "object" ? seo.site_name : website == null ? void 0 : website.site_name;
|
|
28
|
-
return typeof siteName === "string" && siteName.trim() ? siteName.trim() : null;
|
|
29
|
-
}
|
|
30
|
-
function withSiteName(title, siteName) {
|
|
31
|
-
if (!siteName || title.includes(siteName)) return title;
|
|
32
|
-
return `${title} · ${siteName}`;
|
|
33
|
-
}
|
|
34
|
-
function resolvePageTitle(resolved, options = {}) {
|
|
35
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
36
|
-
const hasBinding = !!((_a = resolved.page) == null ? void 0 : _a.data_bindings) && Object.keys(resolved.page.data_bindings).length > 0;
|
|
37
|
-
const contextTitle = hasBinding ? contextPageTitle((_b = primaryPageContext(resolved.contexts)) == null ? void 0 : _b.ctx) : null;
|
|
38
|
-
const overrideTitle = (_c = options.override) == null ? void 0 : _c.trim();
|
|
39
|
-
if (overrideTitle) return overrideTitle;
|
|
40
|
-
if (contextTitle) return withSiteName(contextTitle, options.siteName);
|
|
41
|
-
if ((_e = (_d = resolved.page) == null ? void 0 : _d.meta_title) == null ? void 0 : _e.trim()) return resolved.page.meta_title.trim();
|
|
42
|
-
if ((_g = (_f = resolved.page) == null ? void 0 : _f.title) == null ? void 0 : _g.trim()) return withSiteName(resolved.page.title.trim(), options.siteName);
|
|
43
|
-
if ((_h = options.defaultTitle) == null ? void 0 : _h.trim()) return options.defaultTitle.trim();
|
|
44
|
-
if (options.siteName) return options.siteName;
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
function preserveCurrentSiteSuffix(title, currentTitle) {
|
|
48
|
-
const separator = " · ";
|
|
49
|
-
const suffixIndex = currentTitle.lastIndexOf(separator);
|
|
50
|
-
if (suffixIndex < 0) return title;
|
|
51
|
-
const siteName = currentTitle.slice(suffixIndex + separator.length).trim();
|
|
52
|
-
return withSiteName(title, siteName);
|
|
53
|
-
}
|
|
54
|
-
exports.contextPageTitle = contextPageTitle;
|
|
55
|
-
exports.preserveCurrentSiteSuffix = preserveCurrentSiteSuffix;
|
|
56
|
-
exports.primaryPageContext = primaryPageContext;
|
|
57
|
-
exports.resolvePageTitle = resolvePageTitle;
|
|
58
|
-
exports.siteNameFromContexts = siteNameFromContexts;
|