@shwfed/config 1.1.1 → 1.1.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/module.json +1 -1
- package/dist/module.mjs +3 -0
- package/dist/runtime/components/actions/utils/resolve.js +6 -4
- package/dist/runtime/components/block-layout-editor/meta-strip.vue +7 -8
- package/dist/runtime/components/config/index.d.vue.ts +4 -4
- package/dist/runtime/components/config/index.vue +9 -2
- package/dist/runtime/components/config/index.vue.d.ts +4 -4
- package/dist/runtime/components/config/utils/resolve.js +4 -4
- package/dist/runtime/components/form/utils/resolve.js +4 -4
- package/dist/runtime/components/table/utils/resolve.js +4 -4
- package/dist/runtime/share/define-registry.js +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -157,6 +157,9 @@ const module$1 = defineNuxtModule({
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
addImports([
|
|
160
|
+
// Type-only auto-import: hosts binding `<ShwfedConfig v-model:config>`
|
|
161
|
+
// get `PageConfigValue` globally without reaching into `runtime/`.
|
|
162
|
+
{ name: "PageConfigValue", from: resolver.resolve("./runtime/components/config/schema"), type: true },
|
|
160
163
|
{ name: "provideCELContext", from: resolver.resolve("./runtime/plugins/cel/context") },
|
|
161
164
|
{ name: "openModal", from: resolver.resolve("./runtime/composables/useOverlay") },
|
|
162
165
|
{ name: "confirm", from: resolver.resolve("./runtime/composables/useOverlay") },
|
|
@@ -3,14 +3,16 @@ import { Effect } from "effect";
|
|
|
3
3
|
import { toast } from "vue-sonner";
|
|
4
4
|
import { defineRegistry } from "../../../share/define-registry.js";
|
|
5
5
|
const schemaModules = import.meta.glob(
|
|
6
|
-
"../buttons/*/*/schema.ts",
|
|
7
|
-
{ eager: true }
|
|
6
|
+
"../buttons/*/*/schema.{ts,js}",
|
|
7
|
+
{ eager: true, exhaustive: true }
|
|
8
8
|
);
|
|
9
9
|
const configModuleLoaders = import.meta.glob(
|
|
10
|
-
"../buttons/*/*/config.vue"
|
|
10
|
+
"../buttons/*/*/config.vue",
|
|
11
|
+
{ exhaustive: true }
|
|
11
12
|
);
|
|
12
13
|
const runtimeModuleLoaders = import.meta.glob(
|
|
13
|
-
"../buttons/*/*/runtime.vue"
|
|
14
|
+
"../buttons/*/*/runtime.vue",
|
|
15
|
+
{ exhaustive: true }
|
|
14
16
|
);
|
|
15
17
|
const configModules = Object.fromEntries(
|
|
16
18
|
Object.entries(configModuleLoaders).map(([path, loader]) => [
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
+
import { ExpressionEditor } from "../ui/expression-editor";
|
|
3
4
|
import { Field, FieldLabel } from "../ui/field";
|
|
4
5
|
import { InputGroup, InputGroupInput } from "../ui/input-group";
|
|
5
6
|
import { Markdown } from "../ui/markdown";
|
|
@@ -70,14 +71,12 @@ function updateMedia(value) {
|
|
|
70
71
|
</template>
|
|
71
72
|
匹配条件
|
|
72
73
|
</FieldLabel>
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
/>
|
|
80
|
-
</InputGroup>
|
|
74
|
+
<ExpressionEditor
|
|
75
|
+
:model-value="layout.media ?? ''"
|
|
76
|
+
placeholder="media('(min-width: 1024px)')"
|
|
77
|
+
result-type="bool"
|
|
78
|
+
@update:model-value="(v) => updateMedia(v)"
|
|
79
|
+
/>
|
|
81
80
|
</Field>
|
|
82
81
|
</div>
|
|
83
82
|
</div>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Environment } from '../../vendor/cel-js/lib/index.js';
|
|
2
|
-
import type
|
|
2
|
+
import { type PageConfigValue } from './schema.js';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
configure?: (env: Environment) => void;
|
|
5
5
|
editable?: boolean;
|
|
6
6
|
};
|
|
7
7
|
type __VLS_ModelProps = {
|
|
8
|
-
'config'
|
|
8
|
+
'config'?: PageConfigValue | null | undefined;
|
|
9
9
|
};
|
|
10
10
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
11
11
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -19,7 +19,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
19
19
|
layout: import("../form/schema.js").LayoutValue;
|
|
20
20
|
}>[];
|
|
21
21
|
}>;
|
|
22
|
-
}>) => any;
|
|
22
|
+
}> | null | undefined) => any;
|
|
23
23
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
24
24
|
"onUpdate:config"?: ((value: Readonly<{
|
|
25
25
|
kind: "shwfed.component.page";
|
|
@@ -31,7 +31,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
31
31
|
layout: import("../form/schema.js").LayoutValue;
|
|
32
32
|
}>[];
|
|
33
33
|
}>;
|
|
34
|
-
}>) => any) | undefined;
|
|
34
|
+
}> | null | undefined) => any) | undefined;
|
|
35
35
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
36
|
declare const _default: typeof __VLS_export;
|
|
37
37
|
export default _default;
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { ref, watch } from "vue";
|
|
2
|
+
import { computed, ref, watch } from "vue";
|
|
3
3
|
import { injectCELContext } from "../../plugins/cel/context";
|
|
4
4
|
import SlotRenderer from "../../share/slot-renderer.vue";
|
|
5
5
|
import ShwfedModal from "../modal.vue";
|
|
6
6
|
import EditorBody from "./config.vue";
|
|
7
7
|
import EditorBreadcrumb from "./breadcrumb.vue";
|
|
8
8
|
import EditorFooter from "./footer.vue";
|
|
9
|
+
import { createPageConfig } from "./schema";
|
|
9
10
|
import { useConfigEditor } from "./use-editor";
|
|
10
11
|
import { findBlock } from "./utils/resolve";
|
|
11
12
|
defineOptions({ name: "ShwfedConfig" });
|
|
12
|
-
const
|
|
13
|
+
const configModel = defineModel("config", { type: null });
|
|
14
|
+
const config = computed({
|
|
15
|
+
get: () => configModel.value ?? createPageConfig(),
|
|
16
|
+
set: (next) => {
|
|
17
|
+
configModel.value = next;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
13
20
|
const props = defineProps({
|
|
14
21
|
configure: { type: Function, required: false },
|
|
15
22
|
editable: { type: Boolean, required: false }
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Environment } from '../../vendor/cel-js/lib/index.js';
|
|
2
|
-
import type
|
|
2
|
+
import { type PageConfigValue } from './schema.js';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
configure?: (env: Environment) => void;
|
|
5
5
|
editable?: boolean;
|
|
6
6
|
};
|
|
7
7
|
type __VLS_ModelProps = {
|
|
8
|
-
'config'
|
|
8
|
+
'config'?: PageConfigValue | null | undefined;
|
|
9
9
|
};
|
|
10
10
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
11
11
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -19,7 +19,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
19
19
|
layout: import("../form/schema.js").LayoutValue;
|
|
20
20
|
}>[];
|
|
21
21
|
}>;
|
|
22
|
-
}>) => any;
|
|
22
|
+
}> | null | undefined) => any;
|
|
23
23
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
24
24
|
"onUpdate:config"?: ((value: Readonly<{
|
|
25
25
|
kind: "shwfed.component.page";
|
|
@@ -31,7 +31,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
31
31
|
layout: import("../form/schema.js").LayoutValue;
|
|
32
32
|
}>[];
|
|
33
33
|
}>;
|
|
34
|
-
}>) => any) | undefined;
|
|
34
|
+
}> | null | undefined) => any) | undefined;
|
|
35
35
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
36
|
declare const _default: typeof __VLS_export;
|
|
37
37
|
export default _default;
|
|
@@ -2,16 +2,16 @@ import { Schema } from "effect";
|
|
|
2
2
|
import { defineRegistry } from "../../../share/define-registry.js";
|
|
3
3
|
import { registerBlockRef, registerFindBlock } from "./block-ref-cache.js";
|
|
4
4
|
const schemaModules = import.meta.glob(
|
|
5
|
-
"../blocks/*/*/schema.ts",
|
|
6
|
-
{ eager: true }
|
|
5
|
+
"../blocks/*/*/schema.{ts,js}",
|
|
6
|
+
{ eager: true, exhaustive: true }
|
|
7
7
|
);
|
|
8
8
|
const configModules = import.meta.glob(
|
|
9
9
|
"../blocks/*/*/config.vue",
|
|
10
|
-
{ eager: true, import: "default" }
|
|
10
|
+
{ eager: true, import: "default", exhaustive: true }
|
|
11
11
|
);
|
|
12
12
|
const runtimeModules = import.meta.glob(
|
|
13
13
|
"../blocks/*/*/runtime.vue",
|
|
14
|
-
{ eager: true, import: "default" }
|
|
14
|
+
{ eager: true, import: "default", exhaustive: true }
|
|
15
15
|
);
|
|
16
16
|
const registry = defineRegistry({
|
|
17
17
|
hostName: "shwfed-config",
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineRegistry } from "../../../share/define-registry.js";
|
|
2
2
|
const schemaModules = import.meta.glob(
|
|
3
|
-
"../fields/*/*/schema.ts",
|
|
4
|
-
{ eager: true }
|
|
3
|
+
"../fields/*/*/schema.{ts,js}",
|
|
4
|
+
{ eager: true, exhaustive: true }
|
|
5
5
|
);
|
|
6
6
|
const configModules = import.meta.glob(
|
|
7
7
|
"../fields/*/*/config.vue",
|
|
8
|
-
{ eager: true, import: "default" }
|
|
8
|
+
{ eager: true, import: "default", exhaustive: true }
|
|
9
9
|
);
|
|
10
10
|
const runtimeModules = import.meta.glob(
|
|
11
11
|
"../fields/*/*/runtime.vue",
|
|
12
|
-
{ eager: true, import: "default" }
|
|
12
|
+
{ eager: true, import: "default", exhaustive: true }
|
|
13
13
|
);
|
|
14
14
|
const registry = defineRegistry({
|
|
15
15
|
hostName: "shwfed-form",
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineRegistry } from "../../../share/define-registry.js";
|
|
2
2
|
const schemaModules = import.meta.glob(
|
|
3
|
-
"../columns/*/*/schema.ts",
|
|
4
|
-
{ eager: true }
|
|
3
|
+
"../columns/*/*/schema.{ts,js}",
|
|
4
|
+
{ eager: true, exhaustive: true }
|
|
5
5
|
);
|
|
6
6
|
const configModules = import.meta.glob(
|
|
7
7
|
"../columns/*/*/config.vue",
|
|
8
|
-
{ eager: true, import: "default" }
|
|
8
|
+
{ eager: true, import: "default", exhaustive: true }
|
|
9
9
|
);
|
|
10
10
|
const runtimeModules = import.meta.glob(
|
|
11
11
|
"../columns/*/*/runtime.vue",
|
|
12
|
-
{ eager: true, import: "default" }
|
|
12
|
+
{ eager: true, import: "default", exhaustive: true }
|
|
13
13
|
);
|
|
14
14
|
const registry = defineRegistry({
|
|
15
15
|
hostName: "shwfed-table",
|
|
@@ -8,7 +8,7 @@ export function defineRegistry(options) {
|
|
|
8
8
|
validateModule,
|
|
9
9
|
deriveEntryExtras
|
|
10
10
|
} = options;
|
|
11
|
-
const pathRe = new RegExp(`/${dirSegment}/([^/]+)/([^/]+)/schema\\.ts$`);
|
|
11
|
+
const pathRe = new RegExp(`/${dirSegment}/([^/]+)/([^/]+)/schema\\.(?:ts|js)$`);
|
|
12
12
|
const parsePath = (path) => {
|
|
13
13
|
const match = pathRe.exec(path);
|
|
14
14
|
if (!match) throw new Error(`[${hostName}] unrecognized schema path: ${path}`);
|