@oomol-lab/open-flow 0.1.0-beta.80 → 0.1.0-beta.82
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/README.md +35 -0
- package/dist/browser/{FlowCanvas-CrsiDHK8.js → FlowCanvas-Dew2fmoT.js} +55 -274
- package/dist/browser/{createResourceDialog-CS3u9ga9.js → createResourceDialog-bdOJa5Zk.js} +2 -1
- package/dist/browser/{exportPng-BOPfjeEi.js → exportPng-Cjdb6COo.js} +2 -2
- package/dist/browser/{flowChanges-pFjPHU5k.js → flowChanges-URBEd4DI.js} +2719 -78
- package/dist/browser/{flowWorkspace-CRlqc403.js → flowWorkspace-BlXx-yAn.js} +445 -2699
- package/dist/browser/{markdownContent-CAG_CQfH.js → markdownContent-D8G_oNOe.js} +18 -41
- package/dist/browser/{markdownContent-frwDfQQU.js → markdownContent-IS8xXDoc.js} +18 -40
- package/dist/browser/preview.css +88 -80
- package/dist/browser/preview.js +291 -188
- package/dist/browser/ui.css +8 -0
- package/dist/browser/{dist-CHwj9BhV.js → videoLink-NAWDmBtf.js} +35 -1
- package/dist/browser/workbench-contract.d.ts +6 -0
- package/dist/browser/workbench.css +259 -251
- package/dist/browser/workbench.d.ts +2 -0
- package/dist/browser/workbench.js +311 -143
- package/dist/browser/{ContentIcon-CMn0c-kl.js → wrapLayout-DZvW9dBs.js} +4397 -4152
- package/dist/command/index.js +43 -41
- package/dist/common/authoring.d.ts +1 -1
- package/dist/common/control-api-conformance.js +306 -2
- package/dist/common/control-api.d.ts +20 -0
- package/dist/common/control-api.js +306 -4
- package/dist/common/control-requests.d.ts +3 -5
- package/dist/common/control-requests.js +24 -10
- package/dist/common/flow-authoring.js +19 -3
- package/dist/common/flow-encoding.d.ts +1 -0
- package/dist/common/flow-encoding.js +167 -1
- package/dist/common/flow-semantics.js +44 -7
- package/dist/common/flow-workflowBundle.d.ts +27 -0
- package/dist/common/flow-workflowFile.d.ts +2 -0
- package/dist/common/flow-workflowReferences.d.ts +4 -0
- package/dist/common/mcp.d.ts +2 -0
- package/dist/common/mcp.js +312 -4
- package/dist/render/browser/licenses.md +4047 -0
- package/dist/render/browser/runtime.css +14877 -0
- package/dist/render/browser/runtime.js +266765 -0
- package/dist/render/common/png.d.ts +24 -0
- package/dist/render/node/index.d.ts +11 -0
- package/dist/render/node/index.js +9491 -0
- package/dist/render/node/licenses.md +75 -0
- package/package.json +12 -2
- package/src/connector/common/actionContract.ts +26 -0
- package/src/control/common/api.ts +50 -0
- package/src/control/common/flowDecoders.ts +2 -0
- package/src/control/common/mcp.ts +4 -4
- package/src/control/common/requests.ts +12 -1
- package/src/flow/common/edgeChanges.ts +9 -6
- package/src/flow/common/encoding.ts +1 -0
- package/src/flow/common/semantics.ts +11 -8
- package/src/flow/common/workflowBundle.ts +117 -0
- package/src/flow/common/workflowFile.ts +4 -0
- package/src/flow/common/workflowReferences.ts +20 -0
package/dist/browser/ui.css
CHANGED
|
@@ -1885,6 +1885,10 @@
|
|
|
1885
1885
|
grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
|
|
1886
1886
|
}
|
|
1887
1887
|
|
|
1888
|
+
:where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .grid-rows-\[auto_auto_minmax\(0\,1fr\)_auto\] {
|
|
1889
|
+
grid-template-rows: auto auto minmax(0, 1fr) auto;
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1888
1892
|
:where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .grid-rows-\[auto_minmax\(0\,1fr\)_auto\] {
|
|
1889
1893
|
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
1890
1894
|
}
|
|
@@ -2752,6 +2756,10 @@
|
|
|
2752
2756
|
padding-left: calc(var(--spacing) * 4);
|
|
2753
2757
|
}
|
|
2754
2758
|
|
|
2759
|
+
:where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .pl-5 {
|
|
2760
|
+
padding-left: calc(var(--spacing) * 5);
|
|
2761
|
+
}
|
|
2762
|
+
|
|
2755
2763
|
:where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .pl-6 {
|
|
2756
2764
|
padding-left: calc(var(--spacing) * 6);
|
|
2757
2765
|
}
|
|
@@ -478,4 +478,38 @@ var isObject = (x) => x !== null && typeof x === "object";
|
|
|
478
478
|
var isPlainObject = (x) => isObject(x) && !isArray(x);
|
|
479
479
|
var toPlainObject = (x) => isPlainObject(x) ? x : void 0;
|
|
480
480
|
//#endregion
|
|
481
|
-
|
|
481
|
+
//#region src/ui/browser/markdown/videoLink.ts
|
|
482
|
+
function getVideoLink(href) {
|
|
483
|
+
let url;
|
|
484
|
+
try {
|
|
485
|
+
url = new URL(href);
|
|
486
|
+
} catch {
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
if (url.protocol !== "https:" && url.protocol !== "http:") return;
|
|
490
|
+
const host = url.hostname.replace(/^www\./, "");
|
|
491
|
+
const youtubeId = host === "youtube.com" && url.pathname === "/watch" ? url.searchParams.get("v") : host === "youtu.be" ? url.pathname.slice(1) : null;
|
|
492
|
+
if (youtubeId && /^[a-zA-Z0-9_-]+$/.test(youtubeId)) return {
|
|
493
|
+
src: `https://www.youtube.com/embed/${youtubeId}`,
|
|
494
|
+
titleKey: "markdown.videoYouTube"
|
|
495
|
+
};
|
|
496
|
+
const bilibiliId = host === "bilibili.com" ? url.pathname.match(/^\/video\/(BV[a-zA-Z0-9]+)\/?$/)?.[1] : void 0;
|
|
497
|
+
if (bilibiliId) return {
|
|
498
|
+
src: `https://player.bilibili.com/player.html?bvid=${bilibiliId}&autoplay=0`,
|
|
499
|
+
titleKey: "markdown.videoBilibili"
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
function pasteVideoLink(event, t) {
|
|
503
|
+
const textarea = event.currentTarget;
|
|
504
|
+
if (event.defaultPrevented || textarea.readOnly || textarea.disabled) return;
|
|
505
|
+
const href = event.clipboardData.getData("text/plain").trim();
|
|
506
|
+
if (/\s/.test(href)) return;
|
|
507
|
+
const video = getVideoLink(href);
|
|
508
|
+
if (!video) return;
|
|
509
|
+
const destination = href.replaceAll("(", "%28").replaceAll(")", "%29");
|
|
510
|
+
const markdown = `[](${destination})`;
|
|
511
|
+
event.preventDefault();
|
|
512
|
+
textarea.ownerDocument.execCommand("insertText", false, markdown);
|
|
513
|
+
}
|
|
514
|
+
//#endregion
|
|
515
|
+
export { readonlyVal as _, isPlainObject as a, I18nProvider as c, useTranslate as d, useVal as f, derive as g, compute as h, isBoolean as i, useI18n as l, combine as m, pasteVideoLink as n, isString as o, attachSetter as p, isArray as r, toPlainObject as s, getVideoLink as t, useLang as u, strictEqual as v, val as y };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { WorkflowBundleImportResult } from '../common/control-api.js';
|
|
1
2
|
import type { FlowCatalogEvent, FlowChangeEvent } from './flow-notifications.js';
|
|
3
|
+
import type { WorkflowBundle } from '../common/flow-workflowBundle.js';
|
|
2
4
|
import type { UiLanguage } from '../common/localization.js';
|
|
3
5
|
export type { FlowCatalogEvent, FlowChangeEvent } from './flow-notifications.js';
|
|
4
6
|
export type WorkbenchLanguage = UiLanguage;
|
|
@@ -64,3 +66,7 @@ export interface OpenFlowWorkbenchHandle {
|
|
|
64
66
|
/** Opens confirmation on an idle, initialized Flow list. Invalid files notify the host. Does not create a Flow. */
|
|
65
67
|
openImport(input: WorkbenchImportInput): 'opened' | 'unavailable' | 'invalid-file';
|
|
66
68
|
}
|
|
69
|
+
/** The host must create every member using the selected destination scope. */
|
|
70
|
+
export type WorkflowBundleImporter = (file: WorkflowBundle, name: string, idempotencyKey: string, options?: {
|
|
71
|
+
readonly tagIds?: readonly string[];
|
|
72
|
+
}) => Promise<WorkflowBundleImportResult>;
|