@lingfan-engine/create 0.3.6 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingfan-engine/create",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "type": "module",
5
5
  "description": "工程生成器:从模板骨架生成新工程,可选框架与壳",
6
6
  "license": "Apache-2.0",
@@ -0,0 +1,23 @@
1
+ /**
2
+ * 这一列演示挂载界面:`mount(句柄, 显隐, props)`。
3
+ *
4
+ * 界面本体在 `src/ui/hint/hint.tsx`——目录名就是 UI 名,故事源默认导入它,
5
+ * 绑定名必须与目录名一致,构建期逐条校验。`props` 整份替换而不是逐字段合并,
6
+ * 值必须 JSON 安全(随快照存档),要操作引擎就走运行期注入的 `controls`。
7
+ */
8
+ import { mount, script } from "@lingfan-engine/editor";
9
+
10
+ import hint from "../../ui/hint/hint.tsx";
11
+
12
+ const { say } = script;
13
+
14
+ export const columnType = "ui";
15
+
16
+ export default function look_around(): void {
17
+ mount(hint, true, { text: "提示条从这一列的 mount 调用挂上来" });
18
+ say("你绕着走了一圈,什么也没发生。", "旁白");
19
+ say(
20
+ "提示条是 src/ui/hint/hint.tsx,挂载语句在 src/Stories.src/title/look_around.ts。",
21
+ "旁白",
22
+ );
23
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * 常驻提示条:一块贴在舞台上沿的只读小牌子。
3
+ *
4
+ * 三条约定与宿主形态无关——样式内联、不依赖 stage.css;只读部分设
5
+ * `pointerEvents: "none"`,不吃舞台上的点击;不读引擎状态(显隐由 `mount` 决定,
6
+ * 文案由 `props` 给,操作走 `controls`)。
7
+ */
8
+ export default function Hint(props: { text?: string }) {
9
+ const text = props.text ?? "";
10
+ if (text === "") return null;
11
+ return (
12
+ <div
13
+ role="status"
14
+ style={{
15
+ position: "absolute",
16
+ top: "1rem",
17
+ left: "50%",
18
+ transform: "translateX(-50%)",
19
+ padding: "0.25rem 0.75rem",
20
+ borderRadius: "999px",
21
+ background: "rgba(0, 0, 0, 0.55)",
22
+ color: "#f4f1e8",
23
+ fontSize: "0.875rem",
24
+ pointerEvents: "none",
25
+ }}
26
+ >
27
+ {text}
28
+ </div>
29
+ );
30
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * 这一列演示挂载界面:`mount(句柄, 显隐, props)`。
3
+ *
4
+ * 界面本体在 `src/ui/hint/hint.vue`——目录名就是 UI 名,故事源默认导入它,
5
+ * 绑定名必须与目录名一致,构建期逐条校验。`props` 整份替换而不是逐字段合并,
6
+ * 值必须 JSON 安全(随快照存档),要操作引擎就走运行期注入的 `controls`。
7
+ */
8
+ import { mount, script } from "@lingfan-engine/editor";
9
+
10
+ import hint from "../../ui/hint/hint.vue";
11
+
12
+ const { say } = script;
13
+
14
+ export const columnType = "ui";
15
+
16
+ export default function look_around(): void {
17
+ mount(hint, true, { text: "提示条从这一列的 mount 调用挂上来" });
18
+ say("你绕着走了一圈,什么也没发生。", "旁白");
19
+ say(
20
+ "提示条是 src/ui/hint/hint.vue,挂载语句在 src/Stories.src/title/look_around.ts。",
21
+ "旁白",
22
+ );
23
+ }
@@ -0,0 +1,29 @@
1
+ <!--
2
+ 常驻提示条:一块贴在舞台上沿的只读小牌子。
3
+
4
+ 三条约定与宿主形态无关——自带 scoped 样式、不依赖 stage.css;只读部分设
5
+ `pointer-events: none`,不吃舞台上的点击;不读引擎状态(显隐由 `mount` 决定,
6
+ 文案由 `props` 给,操作走 `controls`)。
7
+ -->
8
+ <script setup lang="ts">
9
+ withDefaults(defineProps<{ text?: string }>(), { text: "" });
10
+ </script>
11
+
12
+ <template>
13
+ <div v-if="text !== ''" class="hint" role="status">{{ text }}</div>
14
+ </template>
15
+
16
+ <style scoped>
17
+ .hint {
18
+ position: absolute;
19
+ top: 1rem;
20
+ left: 50%;
21
+ transform: translateX(-50%);
22
+ padding: 0.25rem 0.75rem;
23
+ border-radius: 999px;
24
+ background: rgb(0 0 0 / 55%);
25
+ color: #f4f1e8;
26
+ font-size: 0.875rem;
27
+ pointer-events: none;
28
+ }
29
+ </style>
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.13.0",
2
+ "version": "1.14.0",
3
3
  "minEngineVersion": "0.3.2",
4
4
  "placeholder": "__PROJECT__",
5
5
  "frameworks": [