@chanmeng666/archlang-3d 0.7.0 → 0.8.0
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 +65 -0
- package/README.md +4 -4
- package/dist/browser.d.ts +3 -5
- package/dist/browser.js +87 -472
- package/dist/{camera-CGIIudHj.d.ts → camera-BAsRq_eC.d.ts} +1 -1
- package/dist/{chunk-GXWLZ2KC.js → chunk-B4PZWWSP.js} +392 -29
- package/dist/{chunk-TI4RYEOL.js → chunk-LNIVDMPG.js} +75 -5
- package/dist/{chunk-FVD3DZU2.js → chunk-MCASL4MM.js} +15 -6
- package/dist/chunk-MXKKNJPU.js +983 -0
- package/dist/{chunk-FHBR2U5Z.js → chunk-VMVKI2WQ.js} +65 -3
- package/dist/{chunk-QN4LQTVG.js → chunk-WARUDAOQ.js} +128 -44
- package/dist/cli.js +12 -6
- package/dist/{facts-3wb9egIT.d.ts → facts-CsO0xtFw.d.ts} +1 -1
- package/dist/index.d.ts +104 -35
- package/dist/index.js +19 -5
- package/dist/node.d.ts +23 -7
- package/dist/node.js +4 -4
- package/dist/{strip-Sdsm54Qw.d.ts → payload-DwiB2P7x.d.ts} +232 -12
- package/dist/replay.d.ts +1 -115
- package/dist/scene3d.schema.json +12 -0
- package/dist/viewer.iife.js +181 -181
- package/package.json +3 -3
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ARCHLANG_3D_VERSION,
|
|
3
3
|
validateScene3D
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-B4PZWWSP.js";
|
|
5
5
|
import {
|
|
6
6
|
PREVIEW_LABEL,
|
|
7
7
|
PREVIEW_LIMITS,
|
|
8
8
|
VIEW_CONTROLS_LABEL,
|
|
9
|
+
noticeLevelLabel,
|
|
9
10
|
replayPayload
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VMVKI2WQ.js";
|
|
11
12
|
import {
|
|
12
13
|
FENCE_PALETTE,
|
|
13
14
|
FINISH_PALETTE,
|
|
@@ -20,7 +21,7 @@ import {
|
|
|
20
21
|
keyFrames,
|
|
21
22
|
linearRgb,
|
|
22
23
|
slotGroups
|
|
23
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-LNIVDMPG.js";
|
|
24
25
|
|
|
25
26
|
// src/world.ts
|
|
26
27
|
import { readFileSync, realpathSync, statSync } from "node:fs";
|
|
@@ -141,7 +142,9 @@ ${readFileSync2(join(dir, "LICENSE"), "utf8")}`;
|
|
|
141
142
|
}
|
|
142
143
|
var escapeHtml = (s) => s.replace(/[&<>"]/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """ })[c]);
|
|
143
144
|
async function replayHtml(mesh, opts) {
|
|
144
|
-
const
|
|
145
|
+
const { notices: given, ...payloadOpts } = opts;
|
|
146
|
+
const notices = given ?? [];
|
|
147
|
+
const payload = replayPayload(mesh, payloadOpts);
|
|
145
148
|
const json = JSON.stringify(payload).replace(/</g, "\\u003c");
|
|
146
149
|
const script = (await viewerScript()).replace(/<\/script/gi, "<\\/script");
|
|
147
150
|
const bg = payload.theme === "dark" ? "#0f2235" : "#f7f5f0";
|
|
@@ -170,7 +173,10 @@ canvas:focus-visible{outline:2px solid ${fg};outline-offset:2px}
|
|
|
170
173
|
.archlang-views button{font:inherit;font-size:13px;padding:2px 10px;border:1px solid ${fg};border-radius:4px;background:transparent;color:${fg};cursor:pointer}
|
|
171
174
|
.archlang-views button[aria-pressed=true]{background:${fg};color:${bg}}
|
|
172
175
|
.archlang-views-storeys{display:inline-flex;align-items:center;gap:4px;margin-left:8px}
|
|
173
|
-
.archlang-views-hint{flex-basis:100%;text-align:center;font-size:12px;opacity:.8}
|
|
176
|
+
.archlang-views-hint{flex-basis:100%;text-align:center;font-size:12px;opacity:.8}${notices.length > 0 ? `
|
|
177
|
+
.archlang-notices{display:grid;gap:4px;width:min(720px,90vw)}
|
|
178
|
+
.archlang-notices p{opacity:1;padding:6px 10px;border-left:3px solid #b45309;background:rgba(180,83,9,.08)}
|
|
179
|
+
.archlang-notices code{font-size:11.5px;margin-right:6px}` : ""}
|
|
174
180
|
</style>
|
|
175
181
|
</head>
|
|
176
182
|
<body>
|
|
@@ -180,7 +186,10 @@ canvas:focus-visible{outline:2px solid ${fg};outline-offset:2px}
|
|
|
180
186
|
<div id="archlang-replay-strip" role="group" aria-label="Plan facts" hidden></div>` : ""}
|
|
181
187
|
</div>
|
|
182
188
|
<input id="archlang-replay-t" type="range" min="0" max="1" step="0.001" value="0" aria-label="Replay position">
|
|
183
|
-
<div id="archlang-replay-views"></div>
|
|
189
|
+
<div id="archlang-replay-views"></div>${notices.length > 0 ? `
|
|
190
|
+
<div class="archlang-notices" role="note">
|
|
191
|
+
${notices.map((n) => `<p>${n.level === void 0 ? "" : `${noticeLevelLabel(n.level)} `}<code>${escapeHtml(n.code)}</code> ${escapeHtml(n.message)}</p>`).join("\n")}
|
|
192
|
+
</div>` : ""}
|
|
184
193
|
<p>${escapeHtml(PREVIEW_LABEL)}</p>
|
|
185
194
|
<p>${escapeHtml(PREVIEW_LIMITS)}</p>
|
|
186
195
|
</main>
|