@floless/app 0.28.0 → 0.30.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/dist/floless-server.cjs +775 -271
- package/dist/schemas/steel.takeoff.v1.schema.json +148 -0
- package/dist/skills/floless-app-tweak-contract/SKILL.md +111 -0
- package/dist/web/app.css +58 -0
- package/dist/web/app.js +4 -1
- package/dist/web/aware.js +217 -3
- package/dist/web/index.html +14 -0
- package/dist/web/renderers.js +25 -0
- package/dist/web/steel-editor.html +1019 -0
- package/package.json +1 -1
package/dist/web/index.html
CHANGED
|
@@ -320,6 +320,19 @@
|
|
|
320
320
|
</div>
|
|
321
321
|
</div>
|
|
322
322
|
|
|
323
|
+
<!-- Dedicated full-window surface for a contract editor (steel takeoff, …).
|
|
324
|
+
Same-origin iframe so the editor reads/writes /api/contract directly
|
|
325
|
+
(unlike the opaque 3D viewer which uses a data: URL and allow-scripts only). -->
|
|
326
|
+
<div id="contract-editor" class="contract-editor" hidden>
|
|
327
|
+
<div class="contract-editor-bar">
|
|
328
|
+
<button id="contract-editor-close" type="button">✕ Close</button>
|
|
329
|
+
<span id="contract-editor-title" class="contract-editor-title"></span>
|
|
330
|
+
<span style="flex:1"></span>
|
|
331
|
+
<button id="contract-editor-approve" type="button" class="primary">✓ Approve & bake lock</button>
|
|
332
|
+
</div>
|
|
333
|
+
<iframe id="contract-editor-frame" title="Contract editor"></iframe>
|
|
334
|
+
</div>
|
|
335
|
+
|
|
323
336
|
<!-- HTML Viewer — renders the report HTML an exec node returned, in-app.
|
|
324
337
|
Double-click a report node on the canvas to run it and open this. -->
|
|
325
338
|
<div class="modal-backdrop report-backdrop" id="report-modal">
|
|
@@ -672,6 +685,7 @@
|
|
|
672
685
|
</div>
|
|
673
686
|
</div>
|
|
674
687
|
<script src="app.js"></script>
|
|
688
|
+
<script src="renderers.js"></script>
|
|
675
689
|
<script src="aware.js"></script>
|
|
676
690
|
<script src="panels.js"></script>
|
|
677
691
|
</body>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
* renderers.js — contract-type → editor-view registry.
|
|
3
|
+
*
|
|
4
|
+
* aware.js is an IIFE (not an ES module), so this file exposes globals too.
|
|
5
|
+
* Include this via <script src="renderers.js"> BEFORE aware.js in index.html.
|
|
6
|
+
*
|
|
7
|
+
* Tier 0: HTML-Viewer (read-only {html}) — rendered by the existing report modal.
|
|
8
|
+
* Tier 1: typed, editable contract — rendered by a dedicated editor page (this file).
|
|
9
|
+
* ========================================================================== */
|
|
10
|
+
|
|
11
|
+
// contract type → descriptor for the editor surface.
|
|
12
|
+
window.CONTRACT_RENDERERS = {
|
|
13
|
+
'steel.takeoff/v1': {
|
|
14
|
+
editorUrl: (appId) => '/steel-editor.html?app=' + encodeURIComponent(appId),
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// Return the contract type string declared on a node, or null when none.
|
|
19
|
+
// A node "emits" a contract type when its config carries a `contract` field,
|
|
20
|
+
// or when its agent is the known steel-takeoff agent.
|
|
21
|
+
window.contractTypeOf = function contractTypeOf(node) {
|
|
22
|
+
return (node && node.config && node.config.contract) ||
|
|
23
|
+
// TODO: drop this agent-name fallback once every steel-takeoff node carries config.contract.
|
|
24
|
+
(node && node.agent === 'steel-takeoff-us' ? 'steel.takeoff/v1' : null);
|
|
25
|
+
};
|