@semiont/react-ui 0.5.1 → 0.5.2
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 +13 -0
- package/dist/{chunk-4NOUO3W6.mjs → chunk-7VWNZ5YX.mjs} +5032 -2876
- package/dist/chunk-7VWNZ5YX.mjs.map +1 -0
- package/dist/index.d.mts +292 -25
- package/dist/index.mjs +1021 -332
- package/dist/index.mjs.map +1 -1
- package/dist/test-utils.d.mts +1 -1
- package/dist/test-utils.mjs +4 -2352
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/StatusDisplay.tsx +1 -1
- package/src/components/modals/PermissionDeniedModal.tsx +2 -2
- package/src/components/modals/SessionExpiredModal.tsx +4 -4
- package/src/components/resource/panels/AssessmentPanel.tsx +4 -0
- package/src/components/resource/panels/AssistSection.tsx +10 -1
- package/src/components/resource/panels/CollaborationPanel.tsx +1 -1
- package/src/components/resource/panels/CommentsPanel.tsx +4 -0
- package/src/components/resource/panels/HighlightPanel.tsx +4 -0
- package/src/components/resource/panels/ReferencesPanel.tsx +11 -0
- package/src/components/resource/panels/TaggingPanel.tsx +10 -0
- package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +11 -1
- package/src/components/resource/panels/__tests__/ReferencesPanel.observable-flow.test.tsx +2 -2
- package/src/features/admin-devops/components/AdminDevOpsPage.tsx +1 -1
- package/src/features/admin-exchange/components/AdminExchangePage.tsx +1 -1
- package/src/features/admin-exchange/components/ImportCard.tsx +1 -1
- package/src/features/admin-exchange/state/__tests__/exchange-state-unit.test.ts +171 -0
- package/src/features/admin-exchange/state/exchange-state-unit.ts +131 -0
- package/src/features/admin-security/components/AdminSecurityPage.tsx +1 -1
- package/src/features/admin-security/state/__tests__/admin-security-state-unit.test.ts +68 -0
- package/src/features/admin-security/state/admin-security-state-unit.ts +46 -0
- package/src/features/admin-users/components/AdminUsersPage.tsx +1 -1
- package/src/features/admin-users/state/__tests__/admin-users-state-unit.test.ts +86 -0
- package/src/features/admin-users/state/admin-users-state-unit.ts +73 -0
- package/src/features/auth-welcome/state/__tests__/welcome-state-unit.test.ts +86 -0
- package/src/features/auth-welcome/state/welcome-state-unit.ts +44 -0
- package/src/features/moderate-entity-tags/components/EntityTagsPage.tsx +1 -1
- package/src/features/moderate-entity-tags/state/__tests__/entity-tags-state-unit.test.ts +102 -0
- package/src/features/moderate-entity-tags/state/entity-tags-state-unit.ts +64 -0
- package/src/features/moderate-recent/components/RecentDocumentsPage.tsx +1 -1
- package/src/features/moderate-tag-schemas/components/TagSchemasPage.tsx +1 -1
- package/src/features/moderation-linked-data/components/LinkedDataPage.tsx +1 -1
- package/src/features/resource-compose/__tests__/UploadProgressBar.test.tsx +225 -0
- package/src/features/resource-compose/components/ResourceComposePage.tsx +19 -4
- package/src/features/resource-compose/components/UploadProgressBar.tsx +94 -0
- package/src/features/resource-compose/state/__tests__/compose-page-state-unit.test.ts +187 -0
- package/src/features/resource-compose/state/compose-page-state-unit.ts +209 -0
- package/src/features/resource-discovery/components/ResourceDiscoveryPage.tsx +1 -1
- package/src/features/resource-discovery/state/__tests__/discover-state-unit.test.ts +76 -0
- package/src/features/resource-discovery/state/discover-state-unit.ts +54 -0
- package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +4 -2
- package/src/features/resource-viewer/components/ResourceViewerPage.tsx +36 -32
- package/src/features/resource-viewer/state/__tests__/resource-loader-state-unit.test.ts +46 -0
- package/src/features/resource-viewer/state/__tests__/resource-viewer-page-state-unit.test.ts +203 -0
- package/src/features/resource-viewer/state/resource-loader-state-unit.ts +26 -0
- package/src/features/resource-viewer/state/resource-viewer-page-state-unit.ts +180 -0
- package/dist/chunk-4NOUO3W6.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -15,8 +15,9 @@ import {
|
|
|
15
15
|
require_bufferToggle,
|
|
16
16
|
require_bufferWhen,
|
|
17
17
|
require_catchError,
|
|
18
|
+
require_cjs,
|
|
18
19
|
require_combineAll,
|
|
19
|
-
|
|
20
|
+
require_combineLatest,
|
|
20
21
|
require_combineLatestAll,
|
|
21
22
|
require_combineLatestWith,
|
|
22
23
|
require_concat,
|
|
@@ -116,14 +117,14 @@ import {
|
|
|
116
117
|
require_windowToggle,
|
|
117
118
|
require_windowWhen,
|
|
118
119
|
require_withLatestFrom,
|
|
119
|
-
|
|
120
|
+
require_zip,
|
|
120
121
|
require_zipAll,
|
|
121
122
|
require_zipWith,
|
|
122
123
|
usePreloadTranslations,
|
|
123
124
|
useSemiont,
|
|
124
125
|
useToast,
|
|
125
126
|
useTranslations
|
|
126
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-7VWNZ5YX.mjs";
|
|
127
128
|
import "./chunk-NOD3NCXE.mjs";
|
|
128
129
|
import {
|
|
129
130
|
__commonJS,
|
|
@@ -132,7 +133,7 @@ import {
|
|
|
132
133
|
} from "./chunk-D4GAAQMM.mjs";
|
|
133
134
|
|
|
134
135
|
// ../../node_modules/inline-style-parser/cjs/index.js
|
|
135
|
-
var
|
|
136
|
+
var require_cjs2 = __commonJS({
|
|
136
137
|
"../../node_modules/inline-style-parser/cjs/index.js"(exports, module) {
|
|
137
138
|
"use strict";
|
|
138
139
|
var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
|
|
@@ -271,7 +272,7 @@ var require_cjs = __commonJS({
|
|
|
271
272
|
});
|
|
272
273
|
|
|
273
274
|
// ../../node_modules/style-to-object/cjs/index.js
|
|
274
|
-
var
|
|
275
|
+
var require_cjs3 = __commonJS({
|
|
275
276
|
"../../node_modules/style-to-object/cjs/index.js"(exports) {
|
|
276
277
|
"use strict";
|
|
277
278
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
@@ -279,7 +280,7 @@ var require_cjs2 = __commonJS({
|
|
|
279
280
|
};
|
|
280
281
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
281
282
|
exports.default = StyleToObject;
|
|
282
|
-
var inline_style_parser_1 = __importDefault(
|
|
283
|
+
var inline_style_parser_1 = __importDefault(require_cjs2());
|
|
283
284
|
function StyleToObject(style, iterator) {
|
|
284
285
|
let styleObject = null;
|
|
285
286
|
if (!style || typeof style !== "string") {
|
|
@@ -344,13 +345,13 @@ var require_utilities = __commonJS({
|
|
|
344
345
|
});
|
|
345
346
|
|
|
346
347
|
// ../../node_modules/style-to-js/cjs/index.js
|
|
347
|
-
var
|
|
348
|
+
var require_cjs4 = __commonJS({
|
|
348
349
|
"../../node_modules/style-to-js/cjs/index.js"(exports, module) {
|
|
349
350
|
"use strict";
|
|
350
351
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
351
352
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
352
353
|
};
|
|
353
|
-
var style_to_object_1 = __importDefault(
|
|
354
|
+
var style_to_object_1 = __importDefault(require_cjs3());
|
|
354
355
|
var utilities_1 = require_utilities();
|
|
355
356
|
function StyleToJS(style, options) {
|
|
356
357
|
var output = {};
|
|
@@ -3145,8 +3146,8 @@ var StateEffectType = class {
|
|
|
3145
3146
|
/**
|
|
3146
3147
|
@internal
|
|
3147
3148
|
*/
|
|
3148
|
-
constructor(
|
|
3149
|
-
this.map =
|
|
3149
|
+
constructor(map10) {
|
|
3150
|
+
this.map = map10;
|
|
3150
3151
|
}
|
|
3151
3152
|
/**
|
|
3152
3153
|
Create a [state effect](https://codemirror.net/6/docs/ref/#state.StateEffect) instance of this
|
|
@@ -3684,9 +3685,9 @@ var EditorState = class _EditorState {
|
|
|
3684
3685
|
literal dollar sign.
|
|
3685
3686
|
*/
|
|
3686
3687
|
phrase(phrase, ...insert2) {
|
|
3687
|
-
for (let
|
|
3688
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
3689
|
-
phrase =
|
|
3688
|
+
for (let map10 of this.facet(_EditorState.phrases))
|
|
3689
|
+
if (Object.prototype.hasOwnProperty.call(map10, phrase)) {
|
|
3690
|
+
phrase = map10[phrase];
|
|
3690
3691
|
break;
|
|
3691
3692
|
}
|
|
3692
3693
|
if (insert2.length)
|
|
@@ -10665,21 +10666,21 @@ var ViewState = class {
|
|
|
10665
10666
|
}
|
|
10666
10667
|
getViewport(bias, scrollTarget) {
|
|
10667
10668
|
let marginTop = 0.5 - Math.max(-0.5, Math.min(0.5, bias / 1e3 / 2));
|
|
10668
|
-
let
|
|
10669
|
+
let map10 = this.heightMap, oracle = this.heightOracle;
|
|
10669
10670
|
let { visibleTop, visibleBottom } = this;
|
|
10670
|
-
let viewport = new Viewport(
|
|
10671
|
+
let viewport = new Viewport(map10.lineAt(visibleTop - marginTop * 1e3, QueryType.ByHeight, oracle, 0, 0).from, map10.lineAt(visibleBottom + (1 - marginTop) * 1e3, QueryType.ByHeight, oracle, 0, 0).to);
|
|
10671
10672
|
if (scrollTarget) {
|
|
10672
10673
|
let { head } = scrollTarget.range;
|
|
10673
10674
|
if (head < viewport.from || head > viewport.to) {
|
|
10674
10675
|
let viewHeight = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top);
|
|
10675
|
-
let block =
|
|
10676
|
+
let block = map10.lineAt(head, QueryType.ByPos, oracle, 0, 0), topPos;
|
|
10676
10677
|
if (scrollTarget.y == "center")
|
|
10677
10678
|
topPos = (block.top + block.bottom) / 2 - viewHeight / 2;
|
|
10678
10679
|
else if (scrollTarget.y == "start" || scrollTarget.y == "nearest" && head < viewport.from)
|
|
10679
10680
|
topPos = block.top;
|
|
10680
10681
|
else
|
|
10681
10682
|
topPos = block.bottom - viewHeight;
|
|
10682
|
-
viewport = new Viewport(
|
|
10683
|
+
viewport = new Viewport(map10.lineAt(topPos - 1e3 / 2, QueryType.ByHeight, oracle, 0, 0).from, map10.lineAt(topPos + viewHeight + 1e3 / 2, QueryType.ByHeight, oracle, 0, 0).to);
|
|
10683
10684
|
}
|
|
10684
10685
|
}
|
|
10685
10686
|
return viewport;
|
|
@@ -12989,10 +12990,10 @@ var keymap = /* @__PURE__ */ Facet.define({ enables: handleKeyEvents });
|
|
|
12989
12990
|
var Keymaps = /* @__PURE__ */ new WeakMap();
|
|
12990
12991
|
function getKeymap(state) {
|
|
12991
12992
|
let bindings = state.facet(keymap);
|
|
12992
|
-
let
|
|
12993
|
-
if (!
|
|
12994
|
-
Keymaps.set(bindings,
|
|
12995
|
-
return
|
|
12993
|
+
let map10 = Keymaps.get(bindings);
|
|
12994
|
+
if (!map10)
|
|
12995
|
+
Keymaps.set(bindings, map10 = buildKeymap(bindings.reduce((a15, b8) => a15.concat(b8), [])));
|
|
12996
|
+
return map10;
|
|
12996
12997
|
}
|
|
12997
12998
|
var storedPrefix = null;
|
|
12998
12999
|
var PrefixTimeout = 4e3;
|
|
@@ -13064,7 +13065,7 @@ function buildKeymap(bindings, platform = currentPlatform) {
|
|
|
13064
13065
|
return bound;
|
|
13065
13066
|
}
|
|
13066
13067
|
var currentKeyEvent = null;
|
|
13067
|
-
function runHandlers(
|
|
13068
|
+
function runHandlers(map10, event, view, scope) {
|
|
13068
13069
|
currentKeyEvent = event;
|
|
13069
13070
|
let name3 = keyName(event);
|
|
13070
13071
|
let charCode = codePointAt2(name3, 0), isChar = codePointSize2(charCode) == name3.length && name3 != " ";
|
|
@@ -13096,7 +13097,7 @@ function runHandlers(map5, event, view, scope) {
|
|
|
13096
13097
|
}
|
|
13097
13098
|
return false;
|
|
13098
13099
|
};
|
|
13099
|
-
let scopeObj =
|
|
13100
|
+
let scopeObj = map10[scope], baseName, shiftName;
|
|
13100
13101
|
if (scopeObj) {
|
|
13101
13102
|
if (runFor(scopeObj[prefix + modifiers(name3, event, !isChar)])) {
|
|
13102
13103
|
handled = true;
|
|
@@ -13773,11 +13774,11 @@ var NodeType = class _NodeType {
|
|
|
13773
13774
|
names, separated by spaces, in a single property name to map
|
|
13774
13775
|
multiple node names to a single value.
|
|
13775
13776
|
*/
|
|
13776
|
-
static match(
|
|
13777
|
+
static match(map10) {
|
|
13777
13778
|
let direct = /* @__PURE__ */ Object.create(null);
|
|
13778
|
-
for (let prop in
|
|
13779
|
+
for (let prop in map10)
|
|
13779
13780
|
for (let name3 of prop.split(" "))
|
|
13780
|
-
direct[name3] =
|
|
13781
|
+
direct[name3] = map10[prop];
|
|
13781
13782
|
return (node2) => {
|
|
13782
13783
|
for (let groups = node2.prop(NodeProp.group), i12 = -1; i12 < (groups ? groups.length : 0); i12++) {
|
|
13783
13784
|
let found = direct[i12 < 0 ? node2.name : groups[i12]];
|
|
@@ -15850,13 +15851,13 @@ var Rule = class {
|
|
|
15850
15851
|
};
|
|
15851
15852
|
Rule.empty = new Rule([], 2, null);
|
|
15852
15853
|
function tagHighlighter(tags3, options) {
|
|
15853
|
-
let
|
|
15854
|
+
let map10 = /* @__PURE__ */ Object.create(null);
|
|
15854
15855
|
for (let style of tags3) {
|
|
15855
15856
|
if (!Array.isArray(style.tag))
|
|
15856
|
-
|
|
15857
|
+
map10[style.tag.id] = style.class;
|
|
15857
15858
|
else
|
|
15858
15859
|
for (let tag of style.tag)
|
|
15859
|
-
|
|
15860
|
+
map10[tag.id] = style.class;
|
|
15860
15861
|
}
|
|
15861
15862
|
let { scope, all: all2 = null } = options || {};
|
|
15862
15863
|
return {
|
|
@@ -15864,7 +15865,7 @@ function tagHighlighter(tags3, options) {
|
|
|
15864
15865
|
let cls = all2;
|
|
15865
15866
|
for (let tag of tags4) {
|
|
15866
15867
|
for (let sub of tag.set) {
|
|
15867
|
-
let tagClass =
|
|
15868
|
+
let tagClass = map10[sub.id];
|
|
15868
15869
|
if (tagClass) {
|
|
15869
15870
|
cls = cls ? cls + " " + tagClass : tagClass;
|
|
15870
15871
|
break;
|
|
@@ -17532,7 +17533,7 @@ function saveSelectedShapeForSelectorType(selectorType, shape) {
|
|
|
17532
17533
|
}
|
|
17533
17534
|
|
|
17534
17535
|
// src/index.ts
|
|
17535
|
-
import { createSearchPipeline as
|
|
17536
|
+
import { createSearchPipeline as createSearchPipeline4 } from "@semiont/sdk";
|
|
17536
17537
|
|
|
17537
17538
|
// src/lib/annotation-overlay.ts
|
|
17538
17539
|
import { getTextPositionSelector, getTargetSelector, getExactText, getBodySource as getBodySource2 } from "@semiont/core";
|
|
@@ -17542,12 +17543,12 @@ function buildSourceToRenderedMap(markdownSource, container) {
|
|
|
17542
17543
|
while (walker.nextNode()) {
|
|
17543
17544
|
renderedText += walker.currentNode.textContent ?? "";
|
|
17544
17545
|
}
|
|
17545
|
-
const
|
|
17546
|
+
const map10 = /* @__PURE__ */ new Map();
|
|
17546
17547
|
let renderedPos = 0;
|
|
17547
17548
|
let sourcePos = 0;
|
|
17548
17549
|
while (sourcePos < markdownSource.length && renderedPos < renderedText.length) {
|
|
17549
17550
|
if (markdownSource[sourcePos] === renderedText[renderedPos]) {
|
|
17550
|
-
|
|
17551
|
+
map10.set(sourcePos, renderedPos);
|
|
17551
17552
|
renderedPos++;
|
|
17552
17553
|
sourcePos++;
|
|
17553
17554
|
} else {
|
|
@@ -17555,10 +17556,10 @@ function buildSourceToRenderedMap(markdownSource, container) {
|
|
|
17555
17556
|
}
|
|
17556
17557
|
}
|
|
17557
17558
|
while (sourcePos < markdownSource.length) {
|
|
17558
|
-
|
|
17559
|
+
map10.set(sourcePos, renderedPos);
|
|
17559
17560
|
sourcePos++;
|
|
17560
17561
|
}
|
|
17561
|
-
return
|
|
17562
|
+
return map10;
|
|
17562
17563
|
}
|
|
17563
17564
|
function buildTextNodeIndex(container) {
|
|
17564
17565
|
const entries = [];
|
|
@@ -18031,12 +18032,12 @@ function sanitizeImageURL(url) {
|
|
|
18031
18032
|
}
|
|
18032
18033
|
}
|
|
18033
18034
|
|
|
18034
|
-
// src/hooks/
|
|
18035
|
+
// src/hooks/useStateUnit.ts
|
|
18035
18036
|
import { useState, useEffect } from "react";
|
|
18036
|
-
function
|
|
18037
|
-
const [
|
|
18038
|
-
useEffect(() => () =>
|
|
18039
|
-
return
|
|
18037
|
+
function useStateUnit(factory) {
|
|
18038
|
+
const [unit] = useState(factory);
|
|
18039
|
+
useEffect(() => () => unit.dispose(), [unit]);
|
|
18040
|
+
return unit;
|
|
18040
18041
|
}
|
|
18041
18042
|
|
|
18042
18043
|
// src/hooks/useDebounce.ts
|
|
@@ -18930,7 +18931,7 @@ function ResourceAnnotationsProvider({ children }) {
|
|
|
18930
18931
|
},
|
|
18931
18932
|
body
|
|
18932
18933
|
};
|
|
18933
|
-
const result = await semiont.mark.annotation(
|
|
18934
|
+
const result = await semiont.mark.annotation(createData);
|
|
18934
18935
|
if (result.annotationId) {
|
|
18935
18936
|
setNewAnnotationIds((prev) => new Set(prev).add(result.annotationId));
|
|
18936
18937
|
setTimeout(() => {
|
|
@@ -32523,7 +32524,7 @@ function stringify2(values2) {
|
|
|
32523
32524
|
}
|
|
32524
32525
|
|
|
32525
32526
|
// ../../node_modules/hast-util-to-jsx-runtime/lib/index.js
|
|
32526
|
-
var import_style_to_js = __toESM(
|
|
32527
|
+
var import_style_to_js = __toESM(require_cjs4(), 1);
|
|
32527
32528
|
|
|
32528
32529
|
// ../../node_modules/unist-util-position/lib/index.js
|
|
32529
32530
|
var pointEnd = point("end");
|
|
@@ -32867,11 +32868,11 @@ function addChildren(props, children) {
|
|
|
32867
32868
|
}
|
|
32868
32869
|
}
|
|
32869
32870
|
}
|
|
32870
|
-
function productionCreate(_4,
|
|
32871
|
+
function productionCreate(_4, jsx92, jsxs82) {
|
|
32871
32872
|
return create2;
|
|
32872
32873
|
function create2(_5, type, props, key) {
|
|
32873
32874
|
const isStaticChildren = Array.isArray(props.children);
|
|
32874
|
-
const fn = isStaticChildren ?
|
|
32875
|
+
const fn = isStaticChildren ? jsxs82 : jsx92;
|
|
32875
32876
|
return key ? fn(type, props, key) : fn(type, props);
|
|
32876
32877
|
}
|
|
32877
32878
|
}
|
|
@@ -39065,11 +39066,11 @@ function createTokenizer(parser6, initialize, from) {
|
|
|
39065
39066
|
constructs2
|
|
39066
39067
|
])
|
|
39067
39068
|
) : handleMapOfConstructs(constructs2);
|
|
39068
|
-
function handleMapOfConstructs(
|
|
39069
|
+
function handleMapOfConstructs(map10) {
|
|
39069
39070
|
return start2;
|
|
39070
39071
|
function start2(code4) {
|
|
39071
|
-
const left = code4 !== null &&
|
|
39072
|
-
const all2 = code4 !== null &&
|
|
39072
|
+
const left = code4 !== null && map10[code4];
|
|
39073
|
+
const all2 = code4 !== null && map10.null;
|
|
39073
39074
|
const list4 = [
|
|
39074
39075
|
// To do: add more extension tests.
|
|
39075
39076
|
/* c8 ignore next 2 */
|
|
@@ -40662,10 +40663,10 @@ var deserializer = ($4, _4) => {
|
|
|
40662
40663
|
return as(new RegExp(source, flags), index2);
|
|
40663
40664
|
}
|
|
40664
40665
|
case MAP: {
|
|
40665
|
-
const
|
|
40666
|
+
const map10 = as(/* @__PURE__ */ new Map(), index2);
|
|
40666
40667
|
for (const [key, index3] of value)
|
|
40667
|
-
|
|
40668
|
-
return
|
|
40668
|
+
map10.set(unpair(key), unpair(index3));
|
|
40669
|
+
return map10;
|
|
40669
40670
|
}
|
|
40670
40671
|
case SET2: {
|
|
40671
40672
|
const set = as(/* @__PURE__ */ new Set(), index2);
|
|
@@ -41170,10 +41171,10 @@ function createState(tree, options) {
|
|
|
41170
41171
|
};
|
|
41171
41172
|
visit(tree, function(node2) {
|
|
41172
41173
|
if (node2.type === "definition" || node2.type === "footnoteDefinition") {
|
|
41173
|
-
const
|
|
41174
|
+
const map10 = node2.type === "definition" ? definitionById : footnoteById;
|
|
41174
41175
|
const id2 = String(node2.identifier).toUpperCase();
|
|
41175
|
-
if (!
|
|
41176
|
-
|
|
41176
|
+
if (!map10.has(id2)) {
|
|
41177
|
+
map10.set(id2, node2);
|
|
41177
41178
|
}
|
|
41178
41179
|
}
|
|
41179
41180
|
});
|
|
@@ -44048,11 +44049,11 @@ function listItem2(node2, parent, state, info) {
|
|
|
44048
44049
|
const exit3 = state.enter("listItem");
|
|
44049
44050
|
const value = state.indentLines(
|
|
44050
44051
|
state.containerFlow(node2, tracker.current()),
|
|
44051
|
-
|
|
44052
|
+
map10
|
|
44052
44053
|
);
|
|
44053
44054
|
exit3();
|
|
44054
44055
|
return value;
|
|
44055
|
-
function
|
|
44056
|
+
function map10(line, index2, blank) {
|
|
44056
44057
|
if (index2) {
|
|
44057
44058
|
return (blank ? "" : " ".repeat(size)) + line;
|
|
44058
44059
|
}
|
|
@@ -45507,7 +45508,7 @@ function resolveTable(events2, context) {
|
|
|
45507
45508
|
let currentTable;
|
|
45508
45509
|
let currentBody;
|
|
45509
45510
|
let currentCell;
|
|
45510
|
-
const
|
|
45511
|
+
const map10 = new EditMap();
|
|
45511
45512
|
while (++index2 < events2.length) {
|
|
45512
45513
|
const event = events2[index2];
|
|
45513
45514
|
const token = event[1];
|
|
@@ -45515,7 +45516,7 @@ function resolveTable(events2, context) {
|
|
|
45515
45516
|
if (token.type === "tableHead") {
|
|
45516
45517
|
afterHeadAwaitingFirstBodyRow = false;
|
|
45517
45518
|
if (lastTableEnd !== 0) {
|
|
45518
|
-
flushTableEnd(
|
|
45519
|
+
flushTableEnd(map10, context, lastTableEnd, currentTable, currentBody);
|
|
45519
45520
|
currentBody = void 0;
|
|
45520
45521
|
lastTableEnd = 0;
|
|
45521
45522
|
}
|
|
@@ -45525,7 +45526,7 @@ function resolveTable(events2, context) {
|
|
|
45525
45526
|
// Note: correct end is set later.
|
|
45526
45527
|
end: Object.assign({}, token.end)
|
|
45527
45528
|
};
|
|
45528
|
-
|
|
45529
|
+
map10.add(index2, 0, [["enter", currentTable, context]]);
|
|
45529
45530
|
} else if (token.type === "tableRow" || token.type === "tableDelimiterRow") {
|
|
45530
45531
|
inFirstCellAwaitingPipe = true;
|
|
45531
45532
|
currentCell = void 0;
|
|
@@ -45539,7 +45540,7 @@ function resolveTable(events2, context) {
|
|
|
45539
45540
|
// Note: correct end is set later.
|
|
45540
45541
|
end: Object.assign({}, token.end)
|
|
45541
45542
|
};
|
|
45542
|
-
|
|
45543
|
+
map10.add(index2, 0, [["enter", currentBody, context]]);
|
|
45543
45544
|
}
|
|
45544
45545
|
rowKind = token.type === "tableDelimiterRow" ? 2 : currentBody ? 3 : 1;
|
|
45545
45546
|
} else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) {
|
|
@@ -45547,7 +45548,7 @@ function resolveTable(events2, context) {
|
|
|
45547
45548
|
if (cell[2] === 0) {
|
|
45548
45549
|
if (lastCell[1] !== 0) {
|
|
45549
45550
|
cell[0] = cell[1];
|
|
45550
|
-
currentCell = flushCell(
|
|
45551
|
+
currentCell = flushCell(map10, context, lastCell, rowKind, void 0, currentCell);
|
|
45551
45552
|
lastCell = [0, 0, 0, 0];
|
|
45552
45553
|
}
|
|
45553
45554
|
cell[2] = index2;
|
|
@@ -45558,7 +45559,7 @@ function resolveTable(events2, context) {
|
|
|
45558
45559
|
} else {
|
|
45559
45560
|
if (lastCell[1] !== 0) {
|
|
45560
45561
|
cell[0] = cell[1];
|
|
45561
|
-
currentCell = flushCell(
|
|
45562
|
+
currentCell = flushCell(map10, context, lastCell, rowKind, void 0, currentCell);
|
|
45562
45563
|
}
|
|
45563
45564
|
lastCell = cell;
|
|
45564
45565
|
cell = [lastCell[1], index2, 0, 0];
|
|
@@ -45571,9 +45572,9 @@ function resolveTable(events2, context) {
|
|
|
45571
45572
|
lastTableEnd = index2;
|
|
45572
45573
|
if (lastCell[1] !== 0) {
|
|
45573
45574
|
cell[0] = cell[1];
|
|
45574
|
-
currentCell = flushCell(
|
|
45575
|
+
currentCell = flushCell(map10, context, lastCell, rowKind, index2, currentCell);
|
|
45575
45576
|
} else if (cell[1] !== 0) {
|
|
45576
|
-
currentCell = flushCell(
|
|
45577
|
+
currentCell = flushCell(map10, context, cell, rowKind, index2, currentCell);
|
|
45577
45578
|
}
|
|
45578
45579
|
rowKind = 0;
|
|
45579
45580
|
} else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) {
|
|
@@ -45581,9 +45582,9 @@ function resolveTable(events2, context) {
|
|
|
45581
45582
|
}
|
|
45582
45583
|
}
|
|
45583
45584
|
if (lastTableEnd !== 0) {
|
|
45584
|
-
flushTableEnd(
|
|
45585
|
+
flushTableEnd(map10, context, lastTableEnd, currentTable, currentBody);
|
|
45585
45586
|
}
|
|
45586
|
-
|
|
45587
|
+
map10.consume(context.events);
|
|
45587
45588
|
index2 = -1;
|
|
45588
45589
|
while (++index2 < context.events.length) {
|
|
45589
45590
|
const event = context.events[index2];
|
|
@@ -45593,12 +45594,12 @@ function resolveTable(events2, context) {
|
|
|
45593
45594
|
}
|
|
45594
45595
|
return events2;
|
|
45595
45596
|
}
|
|
45596
|
-
function flushCell(
|
|
45597
|
+
function flushCell(map10, context, range, rowKind, rowEnd, previousCell) {
|
|
45597
45598
|
const groupName = rowKind === 1 ? "tableHeader" : rowKind === 2 ? "tableDelimiter" : "tableData";
|
|
45598
45599
|
const valueName = "tableContent";
|
|
45599
45600
|
if (range[0] !== 0) {
|
|
45600
45601
|
previousCell.end = Object.assign({}, getPoint(context.events, range[0]));
|
|
45601
|
-
|
|
45602
|
+
map10.add(range[0], 0, [["exit", previousCell, context]]);
|
|
45602
45603
|
}
|
|
45603
45604
|
const now = getPoint(context.events, range[1]);
|
|
45604
45605
|
previousCell = {
|
|
@@ -45607,7 +45608,7 @@ function flushCell(map5, context, range, rowKind, rowEnd, previousCell) {
|
|
|
45607
45608
|
// Note: correct end is set later.
|
|
45608
45609
|
end: Object.assign({}, now)
|
|
45609
45610
|
};
|
|
45610
|
-
|
|
45611
|
+
map10.add(range[1], 0, [["enter", previousCell, context]]);
|
|
45611
45612
|
if (range[2] !== 0) {
|
|
45612
45613
|
const relatedStart = getPoint(context.events, range[2]);
|
|
45613
45614
|
const relatedEnd = getPoint(context.events, range[3]);
|
|
@@ -45616,7 +45617,7 @@ function flushCell(map5, context, range, rowKind, rowEnd, previousCell) {
|
|
|
45616
45617
|
start: Object.assign({}, relatedStart),
|
|
45617
45618
|
end: Object.assign({}, relatedEnd)
|
|
45618
45619
|
};
|
|
45619
|
-
|
|
45620
|
+
map10.add(range[2], 0, [["enter", valueToken, context]]);
|
|
45620
45621
|
if (rowKind !== 2) {
|
|
45621
45622
|
const start2 = context.events[range[2]];
|
|
45622
45623
|
const end = context.events[range[3]];
|
|
@@ -45626,19 +45627,19 @@ function flushCell(map5, context, range, rowKind, rowEnd, previousCell) {
|
|
|
45626
45627
|
if (range[3] > range[2] + 1) {
|
|
45627
45628
|
const a15 = range[2] + 1;
|
|
45628
45629
|
const b8 = range[3] - range[2] - 1;
|
|
45629
|
-
|
|
45630
|
+
map10.add(a15, b8, []);
|
|
45630
45631
|
}
|
|
45631
45632
|
}
|
|
45632
|
-
|
|
45633
|
+
map10.add(range[3] + 1, 0, [["exit", valueToken, context]]);
|
|
45633
45634
|
}
|
|
45634
45635
|
if (rowEnd !== void 0) {
|
|
45635
45636
|
previousCell.end = Object.assign({}, getPoint(context.events, rowEnd));
|
|
45636
|
-
|
|
45637
|
+
map10.add(rowEnd, 0, [["exit", previousCell, context]]);
|
|
45637
45638
|
previousCell = void 0;
|
|
45638
45639
|
}
|
|
45639
45640
|
return previousCell;
|
|
45640
45641
|
}
|
|
45641
|
-
function flushTableEnd(
|
|
45642
|
+
function flushTableEnd(map10, context, index2, table2, tableBody) {
|
|
45642
45643
|
const exits = [];
|
|
45643
45644
|
const related = getPoint(context.events, index2);
|
|
45644
45645
|
if (tableBody) {
|
|
@@ -45647,7 +45648,7 @@ function flushTableEnd(map5, context, index2, table2, tableBody) {
|
|
|
45647
45648
|
}
|
|
45648
45649
|
table2.end = Object.assign({}, related);
|
|
45649
45650
|
exits.push(["exit", table2, context]);
|
|
45650
|
-
|
|
45651
|
+
map10.add(index2 + 1, 0, exits);
|
|
45651
45652
|
}
|
|
45652
45653
|
function getPoint(events2, index2) {
|
|
45653
45654
|
const event = events2[index2];
|
|
@@ -46369,6 +46370,7 @@ function AssistSection({
|
|
|
46369
46370
|
annotationType,
|
|
46370
46371
|
isAssisting,
|
|
46371
46372
|
locale,
|
|
46373
|
+
sourceLanguage,
|
|
46372
46374
|
progress
|
|
46373
46375
|
}) {
|
|
46374
46376
|
const panelName = annotationType === "highlight" ? "HighlightPanel" : annotationType === "assessment" ? "AssessmentPanel" : "CommentsPanel";
|
|
@@ -46394,11 +46396,16 @@ function AssistSection({
|
|
|
46394
46396
|
instructions: instructions.trim() || void 0,
|
|
46395
46397
|
tone: (annotationType === "comment" || annotationType === "assessment") && tone ? tone : void 0,
|
|
46396
46398
|
density: (annotationType === "comment" || annotationType === "assessment" || annotationType === "highlight") && useDensity ? density : void 0,
|
|
46397
|
-
|
|
46399
|
+
// Body locale only applies where the LLM writes natural-language text:
|
|
46400
|
+
// comment/assessment have a body, highlight does not.
|
|
46401
|
+
language: annotationType === "comment" || annotationType === "assessment" ? locale : void 0,
|
|
46402
|
+
// Source locale applies to all three — affects analysis quality on
|
|
46403
|
+
// non-English source, regardless of whether a body is produced.
|
|
46404
|
+
sourceLanguage
|
|
46398
46405
|
});
|
|
46399
46406
|
setInstructions("");
|
|
46400
46407
|
setTone("");
|
|
46401
|
-
}, [annotationType, instructions, tone, useDensity, density, locale, session]);
|
|
46408
|
+
}, [annotationType, instructions, tone, useDensity, density, locale, sourceLanguage, session]);
|
|
46402
46409
|
const handleDismissProgress = useCallback17(() => {
|
|
46403
46410
|
session?.client.mark.dismissProgress();
|
|
46404
46411
|
}, [session]);
|
|
@@ -46598,6 +46605,7 @@ function AssessmentPanel({
|
|
|
46598
46605
|
isAssisting = false,
|
|
46599
46606
|
progress,
|
|
46600
46607
|
locale,
|
|
46608
|
+
sourceLanguage,
|
|
46601
46609
|
annotateMode = true,
|
|
46602
46610
|
scrollToAnnotationId,
|
|
46603
46611
|
onScrollCompleted,
|
|
@@ -46744,6 +46752,7 @@ function AssessmentPanel({
|
|
|
46744
46752
|
annotationType: "assessment",
|
|
46745
46753
|
isAssisting,
|
|
46746
46754
|
locale,
|
|
46755
|
+
sourceLanguage,
|
|
46747
46756
|
progress
|
|
46748
46757
|
}
|
|
46749
46758
|
),
|
|
@@ -47001,6 +47010,7 @@ function CommentsPanel({
|
|
|
47001
47010
|
isAssisting = false,
|
|
47002
47011
|
progress,
|
|
47003
47012
|
locale,
|
|
47013
|
+
sourceLanguage,
|
|
47004
47014
|
scrollToAnnotationId,
|
|
47005
47015
|
onScrollCompleted,
|
|
47006
47016
|
hoveredAnnotationId
|
|
@@ -47147,6 +47157,7 @@ function CommentsPanel({
|
|
|
47147
47157
|
annotationType: "comment",
|
|
47148
47158
|
isAssisting,
|
|
47149
47159
|
locale,
|
|
47160
|
+
sourceLanguage,
|
|
47150
47161
|
progress
|
|
47151
47162
|
}
|
|
47152
47163
|
),
|
|
@@ -47236,7 +47247,8 @@ function HighlightPanel({
|
|
|
47236
47247
|
annotateMode = true,
|
|
47237
47248
|
scrollToAnnotationId,
|
|
47238
47249
|
onScrollCompleted,
|
|
47239
|
-
hoveredAnnotationId
|
|
47250
|
+
hoveredAnnotationId,
|
|
47251
|
+
sourceLanguage
|
|
47240
47252
|
}) {
|
|
47241
47253
|
const t12 = useTranslations("HighlightPanel");
|
|
47242
47254
|
const session = useObservable(useSemiont().activeSession$);
|
|
@@ -47312,7 +47324,8 @@ function HighlightPanel({
|
|
|
47312
47324
|
{
|
|
47313
47325
|
annotationType: "highlight",
|
|
47314
47326
|
isAssisting,
|
|
47315
|
-
progress
|
|
47327
|
+
progress,
|
|
47328
|
+
sourceLanguage
|
|
47316
47329
|
}
|
|
47317
47330
|
),
|
|
47318
47331
|
/* @__PURE__ */ jsx36("div", { className: "semiont-panel__list", children: sortedAnnotations.length === 0 ? /* @__PURE__ */ jsx36("p", { className: "semiont-panel__empty", children: t12("noHighlights") }) : sortedAnnotations.map((highlight) => /* @__PURE__ */ jsx36(
|
|
@@ -47564,7 +47577,9 @@ function ReferencesPanel({
|
|
|
47564
47577
|
pendingAnnotation,
|
|
47565
47578
|
scrollToAnnotationId,
|
|
47566
47579
|
onScrollCompleted,
|
|
47567
|
-
hoveredAnnotationId
|
|
47580
|
+
hoveredAnnotationId,
|
|
47581
|
+
locale,
|
|
47582
|
+
sourceLanguage
|
|
47568
47583
|
}) {
|
|
47569
47584
|
const t12 = useTranslations("ReferencesPanel");
|
|
47570
47585
|
const session = useObservable(useSemiont().activeSession$);
|
|
@@ -47645,7 +47660,11 @@ function ReferencesPanel({
|
|
|
47645
47660
|
setLastDetectionLog(null);
|
|
47646
47661
|
session?.client.mark.requestAssist("linking", {
|
|
47647
47662
|
entityTypes: selectedEntityTypes,
|
|
47648
|
-
includeDescriptiveReferences
|
|
47663
|
+
includeDescriptiveReferences,
|
|
47664
|
+
// Body locale stamps the unresolved-reference body's `language`;
|
|
47665
|
+
// sourceLanguage tunes the prompt for non-English source content.
|
|
47666
|
+
language: locale,
|
|
47667
|
+
sourceLanguage
|
|
47649
47668
|
});
|
|
47650
47669
|
};
|
|
47651
47670
|
const hasSavedLogRef = useRef23(false);
|
|
@@ -48168,7 +48187,9 @@ function TaggingPanel({
|
|
|
48168
48187
|
pendingAnnotation,
|
|
48169
48188
|
scrollToAnnotationId,
|
|
48170
48189
|
onScrollCompleted,
|
|
48171
|
-
hoveredAnnotationId
|
|
48190
|
+
hoveredAnnotationId,
|
|
48191
|
+
locale,
|
|
48192
|
+
sourceLanguage
|
|
48172
48193
|
}) {
|
|
48173
48194
|
const t12 = useTranslations("TaggingPanel");
|
|
48174
48195
|
const session = useObservable(useSemiont().activeSession$);
|
|
@@ -48266,7 +48287,11 @@ function TaggingPanel({
|
|
|
48266
48287
|
if (selectedCategories.size > 0) {
|
|
48267
48288
|
session?.client.mark.requestAssist("tagging", {
|
|
48268
48289
|
schemaId: selectedSchemaId,
|
|
48269
|
-
categories: Array.from(selectedCategories)
|
|
48290
|
+
categories: Array.from(selectedCategories),
|
|
48291
|
+
// Body locale stamps the tagging body's `language`; sourceLanguage
|
|
48292
|
+
// tunes the prompt for non-English source content.
|
|
48293
|
+
language: locale,
|
|
48294
|
+
sourceLanguage
|
|
48270
48295
|
});
|
|
48271
48296
|
setSelectedCategories(/* @__PURE__ */ new Set());
|
|
48272
48297
|
}
|
|
@@ -48616,6 +48641,7 @@ function UnifiedAnnotationsPanel(props) {
|
|
|
48616
48641
|
progress,
|
|
48617
48642
|
annotateMode: props.annotateMode,
|
|
48618
48643
|
locale: props.locale,
|
|
48644
|
+
sourceLanguage: props.sourceLanguage,
|
|
48619
48645
|
scrollToAnnotationId: props.scrollToAnnotationId,
|
|
48620
48646
|
onScrollCompleted: props.onScrollCompleted,
|
|
48621
48647
|
hoveredAnnotationId: props.hoveredAnnotationId
|
|
@@ -48640,6 +48666,8 @@ function UnifiedAnnotationsPanel(props) {
|
|
|
48640
48666
|
scrollToAnnotationId: commonProps.scrollToAnnotationId,
|
|
48641
48667
|
onScrollCompleted: commonProps.onScrollCompleted,
|
|
48642
48668
|
hoveredAnnotationId: commonProps.hoveredAnnotationId,
|
|
48669
|
+
locale: commonProps.locale,
|
|
48670
|
+
sourceLanguage: commonProps.sourceLanguage,
|
|
48643
48671
|
allEntityTypes: props.allEntityTypes || [],
|
|
48644
48672
|
generatingReferenceId: props.generatingReferenceId,
|
|
48645
48673
|
referencedBy: props.referencedBy,
|
|
@@ -50905,23 +50933,23 @@ function useDroppableMeasuring(containers, _ref) {
|
|
|
50905
50933
|
return defaultValue;
|
|
50906
50934
|
}
|
|
50907
50935
|
if (!previousValue || previousValue === defaultValue || containersRef.current !== containers || queue != null) {
|
|
50908
|
-
const
|
|
50936
|
+
const map10 = /* @__PURE__ */ new Map();
|
|
50909
50937
|
for (let container of containers) {
|
|
50910
50938
|
if (!container) {
|
|
50911
50939
|
continue;
|
|
50912
50940
|
}
|
|
50913
50941
|
if (queue && queue.length > 0 && !queue.includes(container.id) && container.rect.current) {
|
|
50914
|
-
|
|
50942
|
+
map10.set(container.id, container.rect.current);
|
|
50915
50943
|
continue;
|
|
50916
50944
|
}
|
|
50917
50945
|
const node2 = container.node.current;
|
|
50918
50946
|
const rect = node2 ? new Rect(measure(node2), node2) : null;
|
|
50919
50947
|
container.rect.current = rect;
|
|
50920
50948
|
if (rect) {
|
|
50921
|
-
|
|
50949
|
+
map10.set(container.id, rect);
|
|
50922
50950
|
}
|
|
50923
50951
|
}
|
|
50924
|
-
return
|
|
50952
|
+
return map10;
|
|
50925
50953
|
}
|
|
50926
50954
|
return previousValue;
|
|
50927
50955
|
}, [containers, queue, dragging, disabled, measure]);
|
|
@@ -55841,8 +55869,62 @@ function UserCircleIcon({
|
|
|
55841
55869
|
var ForwardRef17 = /* @__PURE__ */ React42.forwardRef(UserCircleIcon);
|
|
55842
55870
|
var UserCircleIcon_default = ForwardRef17;
|
|
55843
55871
|
|
|
55872
|
+
// src/state/shell-state-unit.ts
|
|
55873
|
+
var import_rxjs = __toESM(require_cjs());
|
|
55874
|
+
var COMMON_PANELS = ["knowledge-base", "user", "settings"];
|
|
55875
|
+
var RESOURCE_PANELS = ["history", "info", "annotations", "collaboration", "jsonld"];
|
|
55876
|
+
var MOTIVATION_TO_TAB = {
|
|
55877
|
+
"linking": "reference",
|
|
55878
|
+
"commenting": "comment",
|
|
55879
|
+
"tagging": "tag",
|
|
55880
|
+
"highlighting": "highlight",
|
|
55881
|
+
"assessing": "assessment"
|
|
55882
|
+
};
|
|
55883
|
+
var tabGenerationCounter = 0;
|
|
55884
|
+
function createShellStateUnit(browser2, options) {
|
|
55885
|
+
const subs = [];
|
|
55886
|
+
const activePanel$ = new import_rxjs.BehaviorSubject(options?.initialPanel ?? null);
|
|
55887
|
+
const scrollToAnnotationId$ = new import_rxjs.BehaviorSubject(null);
|
|
55888
|
+
const panelInitialTab$ = new import_rxjs.BehaviorSubject(null);
|
|
55889
|
+
if (options?.onPanelChange) {
|
|
55890
|
+
const cb = options.onPanelChange;
|
|
55891
|
+
subs.push(activePanel$.subscribe(cb));
|
|
55892
|
+
}
|
|
55893
|
+
subs.push(browser2.stream("panel:toggle").subscribe(({ panel }) => {
|
|
55894
|
+
const current = activePanel$.getValue();
|
|
55895
|
+
activePanel$.next(current === panel ? null : panel);
|
|
55896
|
+
}));
|
|
55897
|
+
subs.push(browser2.stream("panel:open").subscribe(({ panel, scrollToAnnotationId, motivation }) => {
|
|
55898
|
+
if (scrollToAnnotationId) {
|
|
55899
|
+
scrollToAnnotationId$.next(scrollToAnnotationId);
|
|
55900
|
+
}
|
|
55901
|
+
if (motivation) {
|
|
55902
|
+
const tab2 = MOTIVATION_TO_TAB[motivation] || "highlight";
|
|
55903
|
+
panelInitialTab$.next({ tab: tab2, generation: ++tabGenerationCounter });
|
|
55904
|
+
}
|
|
55905
|
+
activePanel$.next(panel);
|
|
55906
|
+
}));
|
|
55907
|
+
subs.push(browser2.stream("panel:close").subscribe(() => {
|
|
55908
|
+
activePanel$.next(null);
|
|
55909
|
+
}));
|
|
55910
|
+
return {
|
|
55911
|
+
activePanel$: activePanel$.asObservable(),
|
|
55912
|
+
scrollToAnnotationId$: scrollToAnnotationId$.asObservable(),
|
|
55913
|
+
panelInitialTab$: panelInitialTab$.asObservable(),
|
|
55914
|
+
openPanel: (panel) => browser2.emit("panel:open", { panel }),
|
|
55915
|
+
closePanel: () => browser2.emit("panel:close", void 0),
|
|
55916
|
+
togglePanel: (panel) => browser2.emit("panel:toggle", { panel }),
|
|
55917
|
+
onScrollCompleted: () => scrollToAnnotationId$.next(null),
|
|
55918
|
+
dispose() {
|
|
55919
|
+
subs.forEach((s11) => s11.unsubscribe());
|
|
55920
|
+
activePanel$.complete();
|
|
55921
|
+
scrollToAnnotationId$.complete();
|
|
55922
|
+
panelInitialTab$.complete();
|
|
55923
|
+
}
|
|
55924
|
+
};
|
|
55925
|
+
}
|
|
55926
|
+
|
|
55844
55927
|
// src/features/admin-devops/components/AdminDevOpsPage.tsx
|
|
55845
|
-
import { COMMON_PANELS } from "@semiont/sdk";
|
|
55846
55928
|
import { jsx as jsx72, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
55847
55929
|
function AdminDevOpsPage({
|
|
55848
55930
|
suggestedFeatures,
|
|
@@ -55914,9 +55996,6 @@ function AdminDevOpsPage({
|
|
|
55914
55996
|
] });
|
|
55915
55997
|
}
|
|
55916
55998
|
|
|
55917
|
-
// src/features/admin-exchange/components/AdminExchangePage.tsx
|
|
55918
|
-
import { COMMON_PANELS as COMMON_PANELS2 } from "@semiont/sdk";
|
|
55919
|
-
|
|
55920
55999
|
// src/features/admin-exchange/components/ExportCard.tsx
|
|
55921
56000
|
import { jsx as jsx73, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
55922
56001
|
function ExportCard({ onExport, isExporting, translations: t12 }) {
|
|
@@ -56127,7 +56206,7 @@ function AdminExchangePage({
|
|
|
56127
56206
|
ToolbarPanels,
|
|
56128
56207
|
Toolbar: Toolbar2
|
|
56129
56208
|
}) {
|
|
56130
|
-
return /* @__PURE__ */ jsxs66("div", { className: `semiont-page${activePanel &&
|
|
56209
|
+
return /* @__PURE__ */ jsxs66("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
56131
56210
|
/* @__PURE__ */ jsxs66("div", { className: "semiont-page__content", children: [
|
|
56132
56211
|
/* @__PURE__ */ jsxs66("div", { className: "semiont-page__header", children: [
|
|
56133
56212
|
/* @__PURE__ */ jsx76("h1", { className: "semiont-page__title", children: t12.title }),
|
|
@@ -56186,7 +56265,6 @@ function AdminExchangePage({
|
|
|
56186
56265
|
}
|
|
56187
56266
|
|
|
56188
56267
|
// src/features/admin-security/components/AdminSecurityPage.tsx
|
|
56189
|
-
import { COMMON_PANELS as COMMON_PANELS3 } from "@semiont/sdk";
|
|
56190
56268
|
import { jsx as jsx77, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
56191
56269
|
function AdminSecurityPage({
|
|
56192
56270
|
providers,
|
|
@@ -56199,7 +56277,7 @@ function AdminSecurityPage({
|
|
|
56199
56277
|
ToolbarPanels,
|
|
56200
56278
|
Toolbar: Toolbar2
|
|
56201
56279
|
}) {
|
|
56202
|
-
return /* @__PURE__ */ jsxs67("div", { className: `semiont-page${activePanel &&
|
|
56280
|
+
return /* @__PURE__ */ jsxs67("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
56203
56281
|
/* @__PURE__ */ jsx77("div", { className: "semiont-page__content", children: /* @__PURE__ */ jsxs67("div", { className: "semiont-page__sections", children: [
|
|
56204
56282
|
/* @__PURE__ */ jsxs67("div", { className: "semiont-page__header", children: [
|
|
56205
56283
|
/* @__PURE__ */ jsx77("h1", { className: "semiont-page__title", children: t12.title }),
|
|
@@ -56282,7 +56360,6 @@ function AdminSecurityPage({
|
|
|
56282
56360
|
}
|
|
56283
56361
|
|
|
56284
56362
|
// src/features/moderation-linked-data/components/LinkedDataPage.tsx
|
|
56285
|
-
import { COMMON_PANELS as COMMON_PANELS4 } from "@semiont/sdk";
|
|
56286
56363
|
import { jsx as jsx78, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
56287
56364
|
function LinkedDataPage({
|
|
56288
56365
|
onExport,
|
|
@@ -56303,7 +56380,7 @@ function LinkedDataPage({
|
|
|
56303
56380
|
ToolbarPanels,
|
|
56304
56381
|
Toolbar: Toolbar2
|
|
56305
56382
|
}) {
|
|
56306
|
-
return /* @__PURE__ */ jsxs68("div", { className: `semiont-page${activePanel &&
|
|
56383
|
+
return /* @__PURE__ */ jsxs68("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
56307
56384
|
/* @__PURE__ */ jsxs68("div", { className: "semiont-page__content", children: [
|
|
56308
56385
|
/* @__PURE__ */ jsxs68("div", { className: "semiont-page__header", children: [
|
|
56309
56386
|
/* @__PURE__ */ jsx78("h1", { className: "semiont-page__title", children: t12.title }),
|
|
@@ -56363,7 +56440,6 @@ function LinkedDataPage({
|
|
|
56363
56440
|
|
|
56364
56441
|
// src/features/admin-users/components/AdminUsersPage.tsx
|
|
56365
56442
|
import { useState as useState43 } from "react";
|
|
56366
|
-
import { COMMON_PANELS as COMMON_PANELS5 } from "@semiont/sdk";
|
|
56367
56443
|
import { Fragment as Fragment15, jsx as jsx79, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
56368
56444
|
function UserTableRow({
|
|
56369
56445
|
user,
|
|
@@ -56456,7 +56532,7 @@ function AdminUsersPage({
|
|
|
56456
56532
|
const matchesStatus = selectedStatus === "all" || userStatus === selectedStatus;
|
|
56457
56533
|
return matchesSearch && matchesRole && matchesStatus;
|
|
56458
56534
|
});
|
|
56459
|
-
return /* @__PURE__ */ jsxs69("div", { className: `semiont-page${activePanel &&
|
|
56535
|
+
return /* @__PURE__ */ jsxs69("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
56460
56536
|
/* @__PURE__ */ jsx79("div", { className: "semiont-page__content", children: /* @__PURE__ */ jsxs69("div", { className: "semiont-page__sections", children: [
|
|
56461
56537
|
/* @__PURE__ */ jsxs69("div", { className: "semiont-page__header-with-action", children: [
|
|
56462
56538
|
/* @__PURE__ */ jsxs69("div", { children: [
|
|
@@ -57075,7 +57151,6 @@ function WelcomePage({
|
|
|
57075
57151
|
}
|
|
57076
57152
|
|
|
57077
57153
|
// src/features/moderate-entity-tags/components/EntityTagsPage.tsx
|
|
57078
|
-
import { COMMON_PANELS as COMMON_PANELS6 } from "@semiont/sdk";
|
|
57079
57154
|
import { Fragment as Fragment17, jsx as jsx84, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
57080
57155
|
function EntityTagsPage({
|
|
57081
57156
|
entityTypes,
|
|
@@ -57096,7 +57171,7 @@ function EntityTagsPage({
|
|
|
57096
57171
|
onAddTag();
|
|
57097
57172
|
}
|
|
57098
57173
|
};
|
|
57099
|
-
return /* @__PURE__ */ jsxs74("div", { className: `semiont-page${activePanel &&
|
|
57174
|
+
return /* @__PURE__ */ jsxs74("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
57100
57175
|
/* @__PURE__ */ jsxs74("div", { className: "semiont-page__content", children: [
|
|
57101
57176
|
/* @__PURE__ */ jsxs74("div", { className: "semiont-page__header", children: [
|
|
57102
57177
|
/* @__PURE__ */ jsx84("h1", { className: "semiont-page__title", children: t12.pageTitle }),
|
|
@@ -57171,7 +57246,6 @@ function EntityTagsPage({
|
|
|
57171
57246
|
}
|
|
57172
57247
|
|
|
57173
57248
|
// src/features/moderate-recent/components/RecentDocumentsPage.tsx
|
|
57174
|
-
import { COMMON_PANELS as COMMON_PANELS7 } from "@semiont/sdk";
|
|
57175
57249
|
import { jsx as jsx85, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
57176
57250
|
function RecentDocumentsPage({
|
|
57177
57251
|
isLoading,
|
|
@@ -57185,7 +57259,7 @@ function RecentDocumentsPage({
|
|
|
57185
57259
|
if (isLoading) {
|
|
57186
57260
|
return /* @__PURE__ */ jsx85("div", { className: "semiont-page__loading", children: /* @__PURE__ */ jsx85("p", { className: "semiont-page__loading-text", children: t12.loading }) });
|
|
57187
57261
|
}
|
|
57188
|
-
return /* @__PURE__ */ jsxs75("div", { className: `semiont-page${activePanel &&
|
|
57262
|
+
return /* @__PURE__ */ jsxs75("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
57189
57263
|
/* @__PURE__ */ jsxs75("div", { className: "semiont-page__content", children: [
|
|
57190
57264
|
/* @__PURE__ */ jsxs75("div", { className: "semiont-page__header", children: [
|
|
57191
57265
|
/* @__PURE__ */ jsx85("h1", { className: "semiont-page__title", children: t12.pageTitle }),
|
|
@@ -57227,7 +57301,6 @@ function RecentDocumentsPage({
|
|
|
57227
57301
|
}
|
|
57228
57302
|
|
|
57229
57303
|
// src/features/moderate-tag-schemas/components/TagSchemasPage.tsx
|
|
57230
|
-
import { COMMON_PANELS as COMMON_PANELS8 } from "@semiont/sdk";
|
|
57231
57304
|
import { jsx as jsx86, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
57232
57305
|
var domainIcons = {
|
|
57233
57306
|
legal: ScaleIcon_default,
|
|
@@ -57252,7 +57325,7 @@ function TagSchemasPage({
|
|
|
57252
57325
|
if (isLoading) {
|
|
57253
57326
|
return /* @__PURE__ */ jsx86("div", { className: "semiont-page__loading", children: /* @__PURE__ */ jsx86("p", { className: "semiont-page__loading-text", children: t12.loading }) });
|
|
57254
57327
|
}
|
|
57255
|
-
return /* @__PURE__ */ jsxs76("div", { className: `semiont-page${activePanel &&
|
|
57328
|
+
return /* @__PURE__ */ jsxs76("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
57256
57329
|
/* @__PURE__ */ jsxs76("div", { className: "semiont-page__content", children: [
|
|
57257
57330
|
/* @__PURE__ */ jsxs76("div", { className: "semiont-page__header", children: [
|
|
57258
57331
|
/* @__PURE__ */ jsx86("h1", { className: "semiont-page__title", children: t12.pageTitle }),
|
|
@@ -57332,8 +57405,78 @@ function TagSchemasPage({
|
|
|
57332
57405
|
// src/features/resource-compose/components/ResourceComposePage.tsx
|
|
57333
57406
|
import { useState as useState45, useEffect as useEffect48 } from "react";
|
|
57334
57407
|
import { isImageMimeType, isPdfMimeType as isPdfMimeType4, LOCALES as LOCALES3 } from "@semiont/core";
|
|
57335
|
-
|
|
57336
|
-
|
|
57408
|
+
|
|
57409
|
+
// src/features/resource-compose/components/UploadProgressBar.tsx
|
|
57410
|
+
import { Fragment as Fragment18, jsx as jsx87, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
57411
|
+
function formatBytes(bytes) {
|
|
57412
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
57413
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
57414
|
+
if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
57415
|
+
return `${(bytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
57416
|
+
}
|
|
57417
|
+
function UploadProgressBar({ progress, label = "Upload" }) {
|
|
57418
|
+
if (!progress) return null;
|
|
57419
|
+
if (progress.phase === "started") {
|
|
57420
|
+
return /* @__PURE__ */ jsxs77("div", { className: "semiont-progress-wrapper", role: "status", "aria-live": "polite", children: [
|
|
57421
|
+
/* @__PURE__ */ jsx87("div", { className: "semiont-progress__label", children: /* @__PURE__ */ jsxs77("span", { children: [
|
|
57422
|
+
label,
|
|
57423
|
+
": starting\u2026"
|
|
57424
|
+
] }) }),
|
|
57425
|
+
/* @__PURE__ */ jsx87("div", { className: "semiont-progress semiont-progress--indeterminate", children: /* @__PURE__ */ jsx87("div", { className: "semiont-progress__fill" }) })
|
|
57426
|
+
] });
|
|
57427
|
+
}
|
|
57428
|
+
if (progress.phase === "progress") {
|
|
57429
|
+
const indeterminate = progress.totalBytes <= 0;
|
|
57430
|
+
const percentage = indeterminate ? 0 : Math.min(100, Math.round(progress.bytesUploaded / progress.totalBytes * 100));
|
|
57431
|
+
return /* @__PURE__ */ jsxs77("div", { className: "semiont-progress-wrapper", role: "status", "aria-live": "polite", children: [
|
|
57432
|
+
/* @__PURE__ */ jsx87("div", { className: "semiont-progress__label", children: indeterminate ? /* @__PURE__ */ jsxs77("span", { children: [
|
|
57433
|
+
label,
|
|
57434
|
+
": ",
|
|
57435
|
+
formatBytes(progress.bytesUploaded),
|
|
57436
|
+
"\u2026"
|
|
57437
|
+
] }) : /* @__PURE__ */ jsxs77(Fragment18, { children: [
|
|
57438
|
+
/* @__PURE__ */ jsxs77("span", { children: [
|
|
57439
|
+
label,
|
|
57440
|
+
": ",
|
|
57441
|
+
percentage,
|
|
57442
|
+
"%"
|
|
57443
|
+
] }),
|
|
57444
|
+
/* @__PURE__ */ jsxs77("span", { children: [
|
|
57445
|
+
formatBytes(progress.bytesUploaded),
|
|
57446
|
+
" / ",
|
|
57447
|
+
formatBytes(progress.totalBytes)
|
|
57448
|
+
] })
|
|
57449
|
+
] }) }),
|
|
57450
|
+
/* @__PURE__ */ jsx87(
|
|
57451
|
+
"div",
|
|
57452
|
+
{
|
|
57453
|
+
className: `semiont-progress${indeterminate ? " semiont-progress--indeterminate" : ""}`,
|
|
57454
|
+
role: "progressbar",
|
|
57455
|
+
"aria-valuemin": 0,
|
|
57456
|
+
"aria-valuemax": indeterminate ? void 0 : 100,
|
|
57457
|
+
"aria-valuenow": indeterminate ? void 0 : percentage,
|
|
57458
|
+
children: /* @__PURE__ */ jsx87(
|
|
57459
|
+
"div",
|
|
57460
|
+
{
|
|
57461
|
+
className: "semiont-progress__fill",
|
|
57462
|
+
style: indeterminate ? void 0 : { width: `${percentage}%` }
|
|
57463
|
+
}
|
|
57464
|
+
)
|
|
57465
|
+
}
|
|
57466
|
+
)
|
|
57467
|
+
] });
|
|
57468
|
+
}
|
|
57469
|
+
return /* @__PURE__ */ jsxs77("div", { className: "semiont-progress-wrapper", role: "status", "aria-live": "polite", children: [
|
|
57470
|
+
/* @__PURE__ */ jsx87("div", { className: "semiont-progress__label", children: /* @__PURE__ */ jsxs77("span", { children: [
|
|
57471
|
+
label,
|
|
57472
|
+
": uploaded"
|
|
57473
|
+
] }) }),
|
|
57474
|
+
/* @__PURE__ */ jsx87("div", { className: "semiont-progress", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": 100, children: /* @__PURE__ */ jsx87("div", { className: "semiont-progress__fill semiont-progress__fill--success", style: { width: "100%" } }) })
|
|
57475
|
+
] });
|
|
57476
|
+
}
|
|
57477
|
+
|
|
57478
|
+
// src/features/resource-compose/components/ResourceComposePage.tsx
|
|
57479
|
+
import { jsx as jsx88, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
57337
57480
|
function ResourceComposePage({
|
|
57338
57481
|
mode,
|
|
57339
57482
|
cloneData,
|
|
@@ -57347,6 +57490,7 @@ function ResourceComposePage({
|
|
|
57347
57490
|
activePanel,
|
|
57348
57491
|
onSaveResource,
|
|
57349
57492
|
onCancel,
|
|
57493
|
+
uploadProgress = null,
|
|
57350
57494
|
translations: t12,
|
|
57351
57495
|
ToolbarPanels,
|
|
57352
57496
|
Toolbar: Toolbar2
|
|
@@ -57447,22 +57591,22 @@ function ResourceComposePage({
|
|
|
57447
57591
|
};
|
|
57448
57592
|
const isClone = mode === "clone";
|
|
57449
57593
|
const isReferenceCompletion = mode === "reference";
|
|
57450
|
-
return /* @__PURE__ */
|
|
57451
|
-
/* @__PURE__ */
|
|
57452
|
-
/* @__PURE__ */
|
|
57453
|
-
/* @__PURE__ */
|
|
57454
|
-
(isClone || isReferenceCompletion) && /* @__PURE__ */
|
|
57455
|
-
isReferenceCompletion && /* @__PURE__ */
|
|
57594
|
+
return /* @__PURE__ */ jsxs78("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
57595
|
+
/* @__PURE__ */ jsxs78("div", { className: "semiont-page__content semiont-page__compose", children: [
|
|
57596
|
+
/* @__PURE__ */ jsxs78("div", { className: "semiont-page__header", children: [
|
|
57597
|
+
/* @__PURE__ */ jsx88("h1", { className: "semiont-page__title", children: isClone ? t12.titleEditClone : isReferenceCompletion ? t12.titleCompleteReference : t12.title }),
|
|
57598
|
+
(isClone || isReferenceCompletion) && /* @__PURE__ */ jsx88("p", { className: "semiont-page__subtitle", children: isClone ? t12.subtitleClone : t12.subtitleReference }),
|
|
57599
|
+
isReferenceCompletion && /* @__PURE__ */ jsx88("div", { className: "semiont-page__reference-notice", children: /* @__PURE__ */ jsx88("p", { className: "semiont-page__reference-notice-text", children: t12.linkedNoticePrefix }) })
|
|
57456
57600
|
] }),
|
|
57457
|
-
gatheredContext && /* @__PURE__ */
|
|
57601
|
+
gatheredContext && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__field", style: {
|
|
57458
57602
|
marginBottom: "1.5rem",
|
|
57459
57603
|
padding: "1rem",
|
|
57460
57604
|
backgroundColor: "var(--semiont-bg-secondary)",
|
|
57461
57605
|
borderRadius: "var(--semiont-radius-md)",
|
|
57462
57606
|
border: "1px solid var(--semiont-border-primary)"
|
|
57463
57607
|
}, children: [
|
|
57464
|
-
/* @__PURE__ */
|
|
57465
|
-
gatheredContext.sourceContext && /* @__PURE__ */
|
|
57608
|
+
/* @__PURE__ */ jsx88("h3", { className: "semiont-form__label", style: { marginBottom: "0.75rem" }, children: "Gathered Context" }),
|
|
57609
|
+
gatheredContext.sourceContext && /* @__PURE__ */ jsx88("div", { style: {
|
|
57466
57610
|
padding: "0.75rem",
|
|
57467
57611
|
backgroundColor: "var(--semiont-bg-primary)",
|
|
57468
57612
|
borderRadius: "var(--semiont-radius-md)",
|
|
@@ -57470,30 +57614,30 @@ function ResourceComposePage({
|
|
|
57470
57614
|
maxHeight: "150px",
|
|
57471
57615
|
overflowY: "auto",
|
|
57472
57616
|
marginBottom: "0.5rem"
|
|
57473
|
-
}, children: /* @__PURE__ */
|
|
57474
|
-
gatheredContext.sourceContext.before && /* @__PURE__ */
|
|
57475
|
-
/* @__PURE__ */
|
|
57617
|
+
}, children: /* @__PURE__ */ jsxs78("div", { style: { fontSize: "var(--semiont-text-sm)", fontFamily: "monospace", whiteSpace: "pre-wrap", color: "var(--semiont-text-secondary)" }, children: [
|
|
57618
|
+
gatheredContext.sourceContext.before && /* @__PURE__ */ jsx88("span", { children: gatheredContext.sourceContext.before }),
|
|
57619
|
+
/* @__PURE__ */ jsx88("span", { style: {
|
|
57476
57620
|
backgroundColor: "var(--semiont-color-primary-100)",
|
|
57477
57621
|
padding: "0 0.25rem",
|
|
57478
57622
|
fontWeight: 600,
|
|
57479
57623
|
color: "var(--semiont-color-primary-900)"
|
|
57480
57624
|
}, children: gatheredContext.sourceContext.selected }),
|
|
57481
|
-
gatheredContext.sourceContext.after && /* @__PURE__ */
|
|
57625
|
+
gatheredContext.sourceContext.after && /* @__PURE__ */ jsx88("span", { children: gatheredContext.sourceContext.after })
|
|
57482
57626
|
] }) }),
|
|
57483
|
-
gatheredContext.graphContext && gatheredContext.graphContext.connections && gatheredContext.graphContext.connections.length > 0 && /* @__PURE__ */
|
|
57627
|
+
gatheredContext.graphContext && gatheredContext.graphContext.connections && gatheredContext.graphContext.connections.length > 0 && /* @__PURE__ */ jsxs78("div", { style: {
|
|
57484
57628
|
padding: "0.5rem 0",
|
|
57485
57629
|
fontSize: "var(--semiont-text-sm)",
|
|
57486
57630
|
color: "var(--semiont-text-secondary)"
|
|
57487
57631
|
}, children: [
|
|
57488
|
-
/* @__PURE__ */
|
|
57489
|
-
gatheredContext.graphContext.connections.map((conn) => /* @__PURE__ */
|
|
57632
|
+
/* @__PURE__ */ jsx88("span", { style: { fontSize: "var(--semiont-text-xs)", fontWeight: 500, marginRight: "0.5rem" }, children: "Connections:" }),
|
|
57633
|
+
gatheredContext.graphContext.connections.map((conn) => /* @__PURE__ */ jsx88("span", { className: "semiont-chip", style: { fontSize: "var(--semiont-text-xs)", padding: "0.125rem 0.5rem", marginRight: "0.25rem" }, children: conn.resourceName }, conn.resourceId))
|
|
57490
57634
|
] })
|
|
57491
57635
|
] }),
|
|
57492
|
-
/* @__PURE__ */
|
|
57493
|
-
/* @__PURE__ */
|
|
57494
|
-
/* @__PURE__ */
|
|
57495
|
-
/* @__PURE__ */
|
|
57496
|
-
/* @__PURE__ */
|
|
57636
|
+
/* @__PURE__ */ jsx88("div", { className: "semiont-form", children: /* @__PURE__ */ jsxs78("form", { onSubmit: handleSaveResource, className: "semiont-form__fields semiont-compose-grid", children: [
|
|
57637
|
+
/* @__PURE__ */ jsxs78("div", { className: "semiont-compose-grid__meta", children: [
|
|
57638
|
+
/* @__PURE__ */ jsxs78("div", { className: "semiont-form__field", children: [
|
|
57639
|
+
/* @__PURE__ */ jsx88("label", { htmlFor: "docName", className: "semiont-form__label", children: t12.resourceName }),
|
|
57640
|
+
/* @__PURE__ */ jsx88(
|
|
57497
57641
|
"input",
|
|
57498
57642
|
{
|
|
57499
57643
|
id: "docName",
|
|
@@ -57507,11 +57651,11 @@ function ResourceComposePage({
|
|
|
57507
57651
|
}
|
|
57508
57652
|
)
|
|
57509
57653
|
] }),
|
|
57510
|
-
/* @__PURE__ */
|
|
57511
|
-
/* @__PURE__ */
|
|
57512
|
-
/* @__PURE__ */
|
|
57513
|
-
/* @__PURE__ */
|
|
57514
|
-
/* @__PURE__ */
|
|
57654
|
+
/* @__PURE__ */ jsxs78("div", { className: "semiont-form__field", children: [
|
|
57655
|
+
/* @__PURE__ */ jsx88("label", { htmlFor: "storagePath", className: "semiont-form__label", children: "Save location" }),
|
|
57656
|
+
/* @__PURE__ */ jsxs78("div", { className: "semiont-input-addon", children: [
|
|
57657
|
+
/* @__PURE__ */ jsx88("span", { className: "semiont-input-addon__prefix", children: "file://" }),
|
|
57658
|
+
/* @__PURE__ */ jsx88(
|
|
57515
57659
|
"input",
|
|
57516
57660
|
{
|
|
57517
57661
|
id: "storagePath",
|
|
@@ -57526,9 +57670,9 @@ function ResourceComposePage({
|
|
|
57526
57670
|
)
|
|
57527
57671
|
] })
|
|
57528
57672
|
] }),
|
|
57529
|
-
(!isReferenceCompletion || selectedEntityTypes.length === 0) && /* @__PURE__ */
|
|
57530
|
-
/* @__PURE__ */
|
|
57531
|
-
/* @__PURE__ */
|
|
57673
|
+
(!isReferenceCompletion || selectedEntityTypes.length === 0) && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__field semiont-form__entity-types", children: [
|
|
57674
|
+
/* @__PURE__ */ jsx88("div", { className: "semiont-form__label", children: t12.entityTypes }),
|
|
57675
|
+
/* @__PURE__ */ jsx88(
|
|
57532
57676
|
"div",
|
|
57533
57677
|
{
|
|
57534
57678
|
className: "semiont-form__entity-type-buttons",
|
|
@@ -57536,7 +57680,7 @@ function ResourceComposePage({
|
|
|
57536
57680
|
"aria-describedby": "entity-types-description",
|
|
57537
57681
|
children: availableEntityTypes.map((type) => {
|
|
57538
57682
|
const isSelected = selectedEntityTypes.includes(type);
|
|
57539
|
-
return /* @__PURE__ */
|
|
57683
|
+
return /* @__PURE__ */ jsx88(
|
|
57540
57684
|
"button",
|
|
57541
57685
|
{
|
|
57542
57686
|
type: "button",
|
|
@@ -57557,7 +57701,7 @@ function ResourceComposePage({
|
|
|
57557
57701
|
})
|
|
57558
57702
|
}
|
|
57559
57703
|
),
|
|
57560
|
-
selectedEntityTypes.length > 0 && /* @__PURE__ */
|
|
57704
|
+
selectedEntityTypes.length > 0 && /* @__PURE__ */ jsxs78(
|
|
57561
57705
|
"div",
|
|
57562
57706
|
{
|
|
57563
57707
|
className: "sr-only",
|
|
@@ -57573,9 +57717,9 @@ function ResourceComposePage({
|
|
|
57573
57717
|
}
|
|
57574
57718
|
)
|
|
57575
57719
|
] }),
|
|
57576
|
-
isReferenceCompletion && selectedEntityTypes.length > 0 && /* @__PURE__ */
|
|
57577
|
-
/* @__PURE__ */
|
|
57578
|
-
/* @__PURE__ */
|
|
57720
|
+
isReferenceCompletion && selectedEntityTypes.length > 0 && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__field semiont-form__entity-types-display", role: "region", "aria-labelledby": "selected-entity-types-label", children: [
|
|
57721
|
+
/* @__PURE__ */ jsx88("h3", { id: "selected-entity-types-label", className: "semiont-form__label", children: t12.entityTypes }),
|
|
57722
|
+
/* @__PURE__ */ jsx88("div", { className: "semiont-form__entity-type-tags", role: "list", children: selectedEntityTypes.map((type) => /* @__PURE__ */ jsx88(
|
|
57579
57723
|
"span",
|
|
57580
57724
|
{
|
|
57581
57725
|
role: "listitem",
|
|
@@ -57585,11 +57729,11 @@ function ResourceComposePage({
|
|
|
57585
57729
|
},
|
|
57586
57730
|
type
|
|
57587
57731
|
)) }),
|
|
57588
|
-
/* @__PURE__ */
|
|
57732
|
+
/* @__PURE__ */ jsx88("p", { className: "semiont-form__helper-text", id: "reference-entity-types-description", children: "These entity types were selected when creating the reference" })
|
|
57589
57733
|
] }),
|
|
57590
|
-
/* @__PURE__ */
|
|
57591
|
-
/* @__PURE__ */
|
|
57592
|
-
/* @__PURE__ */
|
|
57734
|
+
/* @__PURE__ */ jsxs78("div", { className: "semiont-form__field", children: [
|
|
57735
|
+
/* @__PURE__ */ jsx88("label", { htmlFor: "language-select", className: "semiont-form__label", children: t12.language }),
|
|
57736
|
+
/* @__PURE__ */ jsx88(
|
|
57593
57737
|
"select",
|
|
57594
57738
|
{
|
|
57595
57739
|
id: "language-select",
|
|
@@ -57597,16 +57741,16 @@ function ResourceComposePage({
|
|
|
57597
57741
|
onChange: (e6) => setSelectedLanguage(e6.target.value),
|
|
57598
57742
|
disabled: isCreating,
|
|
57599
57743
|
className: "semiont-select",
|
|
57600
|
-
children: LOCALES3.map((lang) => /* @__PURE__ */
|
|
57744
|
+
children: LOCALES3.map((lang) => /* @__PURE__ */ jsx88("option", { value: lang.code, children: lang.nativeName }, lang.code))
|
|
57601
57745
|
}
|
|
57602
57746
|
)
|
|
57603
57747
|
] })
|
|
57604
57748
|
] }),
|
|
57605
|
-
/* @__PURE__ */
|
|
57606
|
-
!isClone && !isReferenceCompletion && /* @__PURE__ */
|
|
57607
|
-
/* @__PURE__ */
|
|
57608
|
-
/* @__PURE__ */
|
|
57609
|
-
/* @__PURE__ */
|
|
57749
|
+
/* @__PURE__ */ jsxs78("div", { className: "semiont-compose-grid__content", children: [
|
|
57750
|
+
!isClone && !isReferenceCompletion && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__field", children: [
|
|
57751
|
+
/* @__PURE__ */ jsx88("label", { className: "semiont-form__label", children: t12.contentSource }),
|
|
57752
|
+
/* @__PURE__ */ jsxs78("div", { className: "semiont-form__content-source-toggle", children: [
|
|
57753
|
+
/* @__PURE__ */ jsxs78(
|
|
57610
57754
|
"button",
|
|
57611
57755
|
{
|
|
57612
57756
|
type: "button",
|
|
@@ -57615,15 +57759,15 @@ function ResourceComposePage({
|
|
|
57615
57759
|
className: "semiont-form__content-source-button",
|
|
57616
57760
|
"data-active": inputMethod === "upload",
|
|
57617
57761
|
children: [
|
|
57618
|
-
/* @__PURE__ */
|
|
57619
|
-
/* @__PURE__ */
|
|
57620
|
-
/* @__PURE__ */
|
|
57762
|
+
/* @__PURE__ */ jsxs78("div", { className: "semiont-form__content-source-icon-wrapper", children: [
|
|
57763
|
+
/* @__PURE__ */ jsx88("span", { className: "semiont-form__content-source-icon", children: "\u{1F4CE}" }),
|
|
57764
|
+
/* @__PURE__ */ jsx88("span", { className: "semiont-form__content-source-label", children: t12.uploadFile })
|
|
57621
57765
|
] }),
|
|
57622
|
-
/* @__PURE__ */
|
|
57766
|
+
/* @__PURE__ */ jsx88("div", { className: "semiont-form__content-source-description", children: t12.uploadFileDescription })
|
|
57623
57767
|
]
|
|
57624
57768
|
}
|
|
57625
57769
|
),
|
|
57626
|
-
/* @__PURE__ */
|
|
57770
|
+
/* @__PURE__ */ jsxs78(
|
|
57627
57771
|
"button",
|
|
57628
57772
|
{
|
|
57629
57773
|
type: "button",
|
|
@@ -57632,20 +57776,20 @@ function ResourceComposePage({
|
|
|
57632
57776
|
className: "semiont-form__content-source-button",
|
|
57633
57777
|
"data-active": inputMethod === "write",
|
|
57634
57778
|
children: [
|
|
57635
|
-
/* @__PURE__ */
|
|
57636
|
-
/* @__PURE__ */
|
|
57637
|
-
/* @__PURE__ */
|
|
57779
|
+
/* @__PURE__ */ jsxs78("div", { className: "semiont-form__content-source-icon-wrapper", children: [
|
|
57780
|
+
/* @__PURE__ */ jsx88("span", { className: "semiont-form__content-source-icon", children: "\u270D\uFE0F" }),
|
|
57781
|
+
/* @__PURE__ */ jsx88("span", { className: "semiont-form__content-source-label", children: t12.writeContent })
|
|
57638
57782
|
] }),
|
|
57639
|
-
/* @__PURE__ */
|
|
57783
|
+
/* @__PURE__ */ jsx88("div", { className: "semiont-form__content-source-description", children: t12.writeContentDescription })
|
|
57640
57784
|
]
|
|
57641
57785
|
}
|
|
57642
57786
|
)
|
|
57643
57787
|
] })
|
|
57644
57788
|
] }),
|
|
57645
|
-
!isClone && !isReferenceCompletion && inputMethod === "upload" && /* @__PURE__ */
|
|
57646
|
-
/* @__PURE__ */
|
|
57647
|
-
/* @__PURE__ */
|
|
57648
|
-
/* @__PURE__ */
|
|
57789
|
+
!isClone && !isReferenceCompletion && inputMethod === "upload" && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__upload-section", children: [
|
|
57790
|
+
/* @__PURE__ */ jsx88("div", { children: /* @__PURE__ */ jsxs78("div", { className: "semiont-form__upload-container", children: [
|
|
57791
|
+
/* @__PURE__ */ jsx88("label", { className: "semiont-form__upload-dropzone", children: /* @__PURE__ */ jsxs78("div", { className: "semiont-form__upload-area", children: [
|
|
57792
|
+
/* @__PURE__ */ jsx88(
|
|
57649
57793
|
"input",
|
|
57650
57794
|
{
|
|
57651
57795
|
type: "file",
|
|
@@ -57655,10 +57799,10 @@ function ResourceComposePage({
|
|
|
57655
57799
|
disabled: isCreating
|
|
57656
57800
|
}
|
|
57657
57801
|
),
|
|
57658
|
-
/* @__PURE__ */
|
|
57659
|
-
/* @__PURE__ */
|
|
57802
|
+
/* @__PURE__ */ jsx88("p", { className: "semiont-form__upload-text", children: uploadedFile ? uploadedFile.name : t12.dropFileOrClick }),
|
|
57803
|
+
/* @__PURE__ */ jsx88("p", { className: "semiont-form__upload-hint", children: t12.supportedFormats })
|
|
57660
57804
|
] }) }),
|
|
57661
|
-
uploadedFile && /* @__PURE__ */
|
|
57805
|
+
uploadedFile && /* @__PURE__ */ jsx88(
|
|
57662
57806
|
"button",
|
|
57663
57807
|
{
|
|
57664
57808
|
type: "button",
|
|
@@ -57673,17 +57817,17 @@ function ResourceComposePage({
|
|
|
57673
57817
|
}
|
|
57674
57818
|
)
|
|
57675
57819
|
] }) }),
|
|
57676
|
-
uploadedFile && /* @__PURE__ */
|
|
57677
|
-
/* @__PURE__ */
|
|
57820
|
+
uploadedFile && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__media-type", children: [
|
|
57821
|
+
/* @__PURE__ */ jsxs78("span", { className: "semiont-form__media-type-label", children: [
|
|
57678
57822
|
t12.mediaType,
|
|
57679
57823
|
":"
|
|
57680
57824
|
] }),
|
|
57681
|
-
/* @__PURE__ */
|
|
57682
|
-
/* @__PURE__ */
|
|
57825
|
+
/* @__PURE__ */ jsx88("code", { className: "semiont-form__media-type-value", children: fileMimeType }),
|
|
57826
|
+
/* @__PURE__ */ jsx88("span", { className: "semiont-form__media-type-lock", title: t12.autoDetected, children: "\u{1F512}" })
|
|
57683
57827
|
] }),
|
|
57684
|
-
uploadedFile && filePreviewUrl && isImageMimeType(fileMimeType) && /* @__PURE__ */
|
|
57685
|
-
/* @__PURE__ */
|
|
57686
|
-
/* @__PURE__ */
|
|
57828
|
+
uploadedFile && filePreviewUrl && isImageMimeType(fileMimeType) && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__image-preview", children: [
|
|
57829
|
+
/* @__PURE__ */ jsx88("p", { className: "semiont-form__image-preview-label", children: "Preview:" }),
|
|
57830
|
+
/* @__PURE__ */ jsx88("div", { className: "semiont-form__image-preview-container", children: /* @__PURE__ */ jsx88(
|
|
57687
57831
|
"img",
|
|
57688
57832
|
{
|
|
57689
57833
|
src: filePreviewUrl,
|
|
@@ -57693,10 +57837,10 @@ function ResourceComposePage({
|
|
|
57693
57837
|
) })
|
|
57694
57838
|
] })
|
|
57695
57839
|
] }),
|
|
57696
|
-
(isClone || isReferenceCompletion || inputMethod === "write") && /* @__PURE__ */
|
|
57697
|
-
!isClone && !isReferenceCompletion && /* @__PURE__ */
|
|
57698
|
-
/* @__PURE__ */
|
|
57699
|
-
/* @__PURE__ */
|
|
57840
|
+
(isClone || isReferenceCompletion || inputMethod === "write") && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__write-section", children: [
|
|
57841
|
+
!isClone && !isReferenceCompletion && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__field", children: [
|
|
57842
|
+
/* @__PURE__ */ jsx88("label", { htmlFor: "format-select", className: "semiont-form__label", children: t12.format }),
|
|
57843
|
+
/* @__PURE__ */ jsxs78(
|
|
57700
57844
|
"select",
|
|
57701
57845
|
{
|
|
57702
57846
|
id: "format-select",
|
|
@@ -57705,16 +57849,16 @@ function ResourceComposePage({
|
|
|
57705
57849
|
disabled: isCreating,
|
|
57706
57850
|
className: "semiont-select",
|
|
57707
57851
|
children: [
|
|
57708
|
-
/* @__PURE__ */
|
|
57709
|
-
/* @__PURE__ */
|
|
57710
|
-
/* @__PURE__ */
|
|
57852
|
+
/* @__PURE__ */ jsx88("option", { value: "text/markdown", children: "Markdown (text/markdown)" }),
|
|
57853
|
+
/* @__PURE__ */ jsx88("option", { value: "text/plain", children: "Plain Text (text/plain)" }),
|
|
57854
|
+
/* @__PURE__ */ jsx88("option", { value: "text/html", children: "HTML (text/html)" })
|
|
57711
57855
|
]
|
|
57712
57856
|
}
|
|
57713
57857
|
)
|
|
57714
57858
|
] }),
|
|
57715
|
-
/* @__PURE__ */
|
|
57716
|
-
/* @__PURE__ */
|
|
57717
|
-
/* @__PURE__ */
|
|
57859
|
+
/* @__PURE__ */ jsxs78("div", { className: "semiont-form__field semiont-form__editor", children: [
|
|
57860
|
+
/* @__PURE__ */ jsx88("label", { className: "semiont-form__label", children: isClone ? t12.resourceContent : t12.content }),
|
|
57861
|
+
/* @__PURE__ */ jsx88("div", { className: "semiont-form__editor-wrapper", lang: selectedLanguage, children: /* @__PURE__ */ jsx88(
|
|
57718
57862
|
CodeMirrorRenderer,
|
|
57719
57863
|
{
|
|
57720
57864
|
content: newResourceContent,
|
|
@@ -57726,9 +57870,9 @@ function ResourceComposePage({
|
|
|
57726
57870
|
}
|
|
57727
57871
|
) })
|
|
57728
57872
|
] }),
|
|
57729
|
-
!isClone && !isReferenceCompletion && /* @__PURE__ */
|
|
57730
|
-
/* @__PURE__ */
|
|
57731
|
-
/* @__PURE__ */
|
|
57873
|
+
!isClone && !isReferenceCompletion && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__field", children: [
|
|
57874
|
+
/* @__PURE__ */ jsx88("label", { htmlFor: "charset-select", className: "semiont-form__label", children: t12.encoding }),
|
|
57875
|
+
/* @__PURE__ */ jsxs78(
|
|
57732
57876
|
"select",
|
|
57733
57877
|
{
|
|
57734
57878
|
id: "charset-select",
|
|
@@ -57737,18 +57881,18 @@ function ResourceComposePage({
|
|
|
57737
57881
|
disabled: isCreating,
|
|
57738
57882
|
className: "semiont-select",
|
|
57739
57883
|
children: [
|
|
57740
|
-
/* @__PURE__ */
|
|
57741
|
-
/* @__PURE__ */
|
|
57742
|
-
/* @__PURE__ */
|
|
57743
|
-
/* @__PURE__ */
|
|
57744
|
-
/* @__PURE__ */
|
|
57884
|
+
/* @__PURE__ */ jsx88("option", { value: "", children: "UTF-8 (default)" }),
|
|
57885
|
+
/* @__PURE__ */ jsx88("option", { value: "iso-8859-1", children: "ISO-8859-1 (Latin-1)" }),
|
|
57886
|
+
/* @__PURE__ */ jsx88("option", { value: "windows-1252", children: "Windows-1252" }),
|
|
57887
|
+
/* @__PURE__ */ jsx88("option", { value: "ascii", children: "ASCII" }),
|
|
57888
|
+
/* @__PURE__ */ jsx88("option", { value: "utf-16le", children: "UTF-16LE" })
|
|
57745
57889
|
]
|
|
57746
57890
|
}
|
|
57747
57891
|
)
|
|
57748
57892
|
] })
|
|
57749
57893
|
] }),
|
|
57750
|
-
isClone && /* @__PURE__ */
|
|
57751
|
-
/* @__PURE__ */
|
|
57894
|
+
isClone && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__checkbox-field", children: [
|
|
57895
|
+
/* @__PURE__ */ jsx88(
|
|
57752
57896
|
"input",
|
|
57753
57897
|
{
|
|
57754
57898
|
id: "archiveOriginal",
|
|
@@ -57759,34 +57903,35 @@ function ResourceComposePage({
|
|
|
57759
57903
|
disabled: isCreating
|
|
57760
57904
|
}
|
|
57761
57905
|
),
|
|
57762
|
-
/* @__PURE__ */
|
|
57906
|
+
/* @__PURE__ */ jsx88("label", { htmlFor: "archiveOriginal", className: "semiont-form__checkbox-label", children: t12.archiveOriginal })
|
|
57763
57907
|
] })
|
|
57764
57908
|
] }),
|
|
57765
|
-
/* @__PURE__ */
|
|
57766
|
-
/* @__PURE__ */
|
|
57909
|
+
/* @__PURE__ */ jsxs78("div", { className: "semiont-form__actions", children: [
|
|
57910
|
+
/* @__PURE__ */ jsx88(
|
|
57767
57911
|
"button",
|
|
57768
57912
|
{
|
|
57769
57913
|
type: "button",
|
|
57770
57914
|
onClick: onCancel,
|
|
57771
|
-
disabled: isCreating,
|
|
57915
|
+
disabled: isCreating || uploadProgress !== null,
|
|
57772
57916
|
className: buttonStyles.tertiary.base,
|
|
57773
57917
|
children: t12.cancel
|
|
57774
57918
|
}
|
|
57775
57919
|
),
|
|
57776
|
-
/* @__PURE__ */
|
|
57920
|
+
/* @__PURE__ */ jsx88(
|
|
57777
57921
|
"button",
|
|
57778
57922
|
{
|
|
57779
57923
|
type: "submit",
|
|
57780
|
-
disabled: isCreating || !newResourceName.trim(),
|
|
57924
|
+
disabled: isCreating || uploadProgress !== null || !newResourceName.trim(),
|
|
57781
57925
|
className: buttonStyles.primary.base,
|
|
57782
57926
|
children: isCreating ? isClone ? t12.saving : isReferenceCompletion ? t12.creatingAndLinking : t12.creating : isClone ? t12.saveClonedResource : isReferenceCompletion ? t12.createAndLinkResource : t12.createResource
|
|
57783
57927
|
}
|
|
57784
57928
|
)
|
|
57785
|
-
] })
|
|
57929
|
+
] }),
|
|
57930
|
+
/* @__PURE__ */ jsx88(UploadProgressBar, { progress: uploadProgress })
|
|
57786
57931
|
] }) })
|
|
57787
57932
|
] }),
|
|
57788
|
-
/* @__PURE__ */
|
|
57789
|
-
/* @__PURE__ */
|
|
57933
|
+
/* @__PURE__ */ jsxs78("div", { className: "semiont-page__sidebar", children: [
|
|
57934
|
+
/* @__PURE__ */ jsx88(
|
|
57790
57935
|
ToolbarPanels,
|
|
57791
57936
|
{
|
|
57792
57937
|
activePanel,
|
|
@@ -57794,7 +57939,7 @@ function ResourceComposePage({
|
|
|
57794
57939
|
showLineNumbers
|
|
57795
57940
|
}
|
|
57796
57941
|
),
|
|
57797
|
-
/* @__PURE__ */
|
|
57942
|
+
/* @__PURE__ */ jsx88(
|
|
57798
57943
|
Toolbar2,
|
|
57799
57944
|
{
|
|
57800
57945
|
context: "simple",
|
|
@@ -57808,18 +57953,17 @@ function ResourceComposePage({
|
|
|
57808
57953
|
// src/features/resource-discovery/components/ResourceDiscoveryPage.tsx
|
|
57809
57954
|
import { useState as useState46, useCallback as useCallback33, useRef as useRef36 } from "react";
|
|
57810
57955
|
import { getResourceId as getResourceId3 } from "@semiont/core";
|
|
57811
|
-
import { COMMON_PANELS as COMMON_PANELS10 } from "@semiont/sdk";
|
|
57812
57956
|
|
|
57813
57957
|
// src/features/resource-discovery/components/ResourceCard.tsx
|
|
57814
57958
|
import React48 from "react";
|
|
57815
|
-
import { jsx as
|
|
57959
|
+
import { jsx as jsx89, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
57816
57960
|
var ResourceCard = React48.memo(({
|
|
57817
57961
|
resource,
|
|
57818
57962
|
onOpen,
|
|
57819
57963
|
tabIndex = 0,
|
|
57820
57964
|
archivedLabel,
|
|
57821
57965
|
createdLabel
|
|
57822
|
-
}) => /* @__PURE__ */
|
|
57966
|
+
}) => /* @__PURE__ */ jsxs79(
|
|
57823
57967
|
"div",
|
|
57824
57968
|
{
|
|
57825
57969
|
onClick: () => onOpen(resource),
|
|
@@ -57834,18 +57978,18 @@ var ResourceCard = React48.memo(({
|
|
|
57834
57978
|
"aria-label": `Open resource: ${resource.name}`,
|
|
57835
57979
|
className: "semiont-resource-card",
|
|
57836
57980
|
children: [
|
|
57837
|
-
/* @__PURE__ */
|
|
57838
|
-
/* @__PURE__ */
|
|
57839
|
-
resource.archived && /* @__PURE__ */
|
|
57981
|
+
/* @__PURE__ */ jsxs79("div", { className: "semiont-resource-card__header", children: [
|
|
57982
|
+
/* @__PURE__ */ jsx89("h4", { className: "semiont-resource-card__title", children: resource.name }),
|
|
57983
|
+
resource.archived && /* @__PURE__ */ jsx89("span", { className: "semiont-resource-card__badge", "data-type": "archived", children: archivedLabel })
|
|
57840
57984
|
] }),
|
|
57841
|
-
/* @__PURE__ */
|
|
57842
|
-
/* @__PURE__ */
|
|
57985
|
+
/* @__PURE__ */ jsxs79("div", { className: "semiont-resource-card__metadata", children: [
|
|
57986
|
+
/* @__PURE__ */ jsxs79("span", { className: "semiont-resource-card__date", children: [
|
|
57843
57987
|
createdLabel,
|
|
57844
57988
|
" ",
|
|
57845
57989
|
resource.dateCreated ? new Date(resource.dateCreated).toLocaleDateString() : "N/A"
|
|
57846
57990
|
] }),
|
|
57847
|
-
resource.entityTypes && resource.entityTypes.length > 0 && /* @__PURE__ */
|
|
57848
|
-
resource.entityTypes.slice(0, 2).map((type) => /* @__PURE__ */
|
|
57991
|
+
resource.entityTypes && resource.entityTypes.length > 0 && /* @__PURE__ */ jsxs79("div", { className: "semiont-tags", children: [
|
|
57992
|
+
resource.entityTypes.slice(0, 2).map((type) => /* @__PURE__ */ jsx89(
|
|
57849
57993
|
"span",
|
|
57850
57994
|
{
|
|
57851
57995
|
className: "semiont-tag semiont-tag--secondary semiont-tag--compact semiont-tag--rounded-sm",
|
|
@@ -57853,7 +57997,7 @@ var ResourceCard = React48.memo(({
|
|
|
57853
57997
|
},
|
|
57854
57998
|
type
|
|
57855
57999
|
)),
|
|
57856
|
-
resource.entityTypes.length > 2 && /* @__PURE__ */
|
|
58000
|
+
resource.entityTypes.length > 2 && /* @__PURE__ */ jsxs79("span", { className: "semiont-tag semiont-tag--secondary semiont-tag--compact semiont-tag--rounded-sm", children: [
|
|
57857
58001
|
"+",
|
|
57858
58002
|
resource.entityTypes.length - 2
|
|
57859
58003
|
] })
|
|
@@ -57865,7 +58009,7 @@ var ResourceCard = React48.memo(({
|
|
|
57865
58009
|
ResourceCard.displayName = "ResourceCard";
|
|
57866
58010
|
|
|
57867
58011
|
// src/features/resource-discovery/components/ResourceDiscoveryPage.tsx
|
|
57868
|
-
import { jsx as
|
|
58012
|
+
import { jsx as jsx90, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
57869
58013
|
function ResourceDiscoveryPage({
|
|
57870
58014
|
recentDocuments,
|
|
57871
58015
|
searchDocuments,
|
|
@@ -57910,18 +58054,18 @@ function ResourceDiscoveryPage({
|
|
|
57910
58054
|
}
|
|
57911
58055
|
}, []);
|
|
57912
58056
|
if (isLoadingRecent) {
|
|
57913
|
-
return /* @__PURE__ */
|
|
58057
|
+
return /* @__PURE__ */ jsx90("div", { className: "semiont-page__loading", children: /* @__PURE__ */ jsx90("p", { className: "semiont-page__loading-text", children: t12.loadingKnowledgeBase }) });
|
|
57914
58058
|
}
|
|
57915
58059
|
const showNoResultsWarning = hasSearchQuery && searchDocuments.length === 0 && !isSearching;
|
|
57916
|
-
return /* @__PURE__ */
|
|
57917
|
-
/* @__PURE__ */
|
|
57918
|
-
/* @__PURE__ */
|
|
57919
|
-
/* @__PURE__ */
|
|
57920
|
-
/* @__PURE__ */
|
|
58060
|
+
return /* @__PURE__ */ jsxs80("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
58061
|
+
/* @__PURE__ */ jsxs80("div", { className: "semiont-page__content", children: [
|
|
58062
|
+
/* @__PURE__ */ jsxs80("div", { className: "semiont-page__header", children: [
|
|
58063
|
+
/* @__PURE__ */ jsx90("h1", { className: "semiont-page__title", children: t12.title }),
|
|
58064
|
+
/* @__PURE__ */ jsx90("p", { className: "semiont-page__subtitle", children: t12.subtitle })
|
|
57921
58065
|
] }),
|
|
57922
|
-
/* @__PURE__ */
|
|
57923
|
-
/* @__PURE__ */
|
|
57924
|
-
/* @__PURE__ */
|
|
58066
|
+
/* @__PURE__ */ jsxs80("div", { className: "semiont-card", children: [
|
|
58067
|
+
/* @__PURE__ */ jsx90("div", { className: "semiont-card__search-form", children: /* @__PURE__ */ jsxs80("div", { className: "semiont-card__search-wrapper", children: [
|
|
58068
|
+
/* @__PURE__ */ jsx90(
|
|
57925
58069
|
"input",
|
|
57926
58070
|
{
|
|
57927
58071
|
type: "text",
|
|
@@ -57932,11 +58076,11 @@ function ResourceDiscoveryPage({
|
|
|
57932
58076
|
"aria-label": t12.searchPlaceholder
|
|
57933
58077
|
}
|
|
57934
58078
|
),
|
|
57935
|
-
isSearching && /* @__PURE__ */
|
|
58079
|
+
isSearching && /* @__PURE__ */ jsx90("span", { className: "semiont-card__search-status", "aria-live": "polite", children: t12.searching })
|
|
57936
58080
|
] }) }),
|
|
57937
|
-
entityTypes.length > 0 && /* @__PURE__ */
|
|
57938
|
-
/* @__PURE__ */
|
|
57939
|
-
/* @__PURE__ */
|
|
58081
|
+
entityTypes.length > 0 && /* @__PURE__ */ jsxs80("div", { className: "semiont-card__filters", children: [
|
|
58082
|
+
/* @__PURE__ */ jsx90("h3", { className: "semiont-card__filters-label", children: t12.filterByEntityType }),
|
|
58083
|
+
/* @__PURE__ */ jsxs80(
|
|
57940
58084
|
"div",
|
|
57941
58085
|
{
|
|
57942
58086
|
ref: entityFilterRoving.containerRef,
|
|
@@ -57945,7 +58089,7 @@ function ResourceDiscoveryPage({
|
|
|
57945
58089
|
role: "group",
|
|
57946
58090
|
"aria-label": "Entity type filters",
|
|
57947
58091
|
children: [
|
|
57948
|
-
/* @__PURE__ */
|
|
58092
|
+
/* @__PURE__ */ jsx90(
|
|
57949
58093
|
"button",
|
|
57950
58094
|
{
|
|
57951
58095
|
onClick: () => handleEntityTypeFilter(""),
|
|
@@ -57956,7 +58100,7 @@ function ResourceDiscoveryPage({
|
|
|
57956
58100
|
children: t12.all
|
|
57957
58101
|
}
|
|
57958
58102
|
),
|
|
57959
|
-
entityTypes.map((type) => /* @__PURE__ */
|
|
58103
|
+
entityTypes.map((type) => /* @__PURE__ */ jsx90(
|
|
57960
58104
|
"button",
|
|
57961
58105
|
{
|
|
57962
58106
|
onClick: () => handleEntityTypeFilter(type),
|
|
@@ -57972,10 +58116,10 @@ function ResourceDiscoveryPage({
|
|
|
57972
58116
|
}
|
|
57973
58117
|
)
|
|
57974
58118
|
] }),
|
|
57975
|
-
/* @__PURE__ */
|
|
57976
|
-
/* @__PURE__ */
|
|
57977
|
-
showNoResultsWarning && /* @__PURE__ */
|
|
57978
|
-
filteredResources.length > 0 ? /* @__PURE__ */
|
|
58119
|
+
/* @__PURE__ */ jsxs80("div", { className: "semiont-card__documents", children: [
|
|
58120
|
+
/* @__PURE__ */ jsx90("h3", { className: "semiont-card__documents-label", children: hasSearchQuery && searchDocuments.length > 0 ? t12.searchResults(searchDocuments.length) : selectedEntityType ? t12.documentsTaggedWith(selectedEntityType) : t12.recentResources }),
|
|
58121
|
+
showNoResultsWarning && /* @__PURE__ */ jsx90("div", { className: "semiont-card__warning", children: /* @__PURE__ */ jsx90("p", { className: "semiont-card__warning-text", children: t12.noResultsFound(searchQuery) }) }),
|
|
58122
|
+
filteredResources.length > 0 ? /* @__PURE__ */ jsx90(
|
|
57979
58123
|
"div",
|
|
57980
58124
|
{
|
|
57981
58125
|
ref: documentGridRoving.containerRef,
|
|
@@ -57983,7 +58127,7 @@ function ResourceDiscoveryPage({
|
|
|
57983
58127
|
className: "semiont-card-grid",
|
|
57984
58128
|
role: "group",
|
|
57985
58129
|
"aria-label": "Document grid",
|
|
57986
|
-
children: filteredResources.map((resource, index2) => /* @__PURE__ */
|
|
58130
|
+
children: filteredResources.map((resource, index2) => /* @__PURE__ */ jsx90(
|
|
57987
58131
|
ResourceCard,
|
|
57988
58132
|
{
|
|
57989
58133
|
resource,
|
|
@@ -57995,9 +58139,9 @@ function ResourceDiscoveryPage({
|
|
|
57995
58139
|
getResourceId3(resource)
|
|
57996
58140
|
))
|
|
57997
58141
|
}
|
|
57998
|
-
) : /* @__PURE__ */
|
|
57999
|
-
/* @__PURE__ */
|
|
58000
|
-
!hasSearchQuery && /* @__PURE__ */
|
|
58142
|
+
) : /* @__PURE__ */ jsxs80("div", { className: "semiont-card__empty", children: [
|
|
58143
|
+
/* @__PURE__ */ jsx90("p", { className: "semiont-card__empty-text", children: t12.noResourcesAvailable }),
|
|
58144
|
+
!hasSearchQuery && /* @__PURE__ */ jsx90(
|
|
58001
58145
|
"button",
|
|
58002
58146
|
{
|
|
58003
58147
|
onClick: onNavigateToCompose,
|
|
@@ -58009,8 +58153,8 @@ function ResourceDiscoveryPage({
|
|
|
58009
58153
|
] })
|
|
58010
58154
|
] })
|
|
58011
58155
|
] }),
|
|
58012
|
-
/* @__PURE__ */
|
|
58013
|
-
/* @__PURE__ */
|
|
58156
|
+
/* @__PURE__ */ jsxs80("div", { className: "semiont-page__sidebar", children: [
|
|
58157
|
+
/* @__PURE__ */ jsx90(
|
|
58014
58158
|
ToolbarPanels,
|
|
58015
58159
|
{
|
|
58016
58160
|
activePanel,
|
|
@@ -58018,7 +58162,7 @@ function ResourceDiscoveryPage({
|
|
|
58018
58162
|
showLineNumbers
|
|
58019
58163
|
}
|
|
58020
58164
|
),
|
|
58021
|
-
/* @__PURE__ */
|
|
58165
|
+
/* @__PURE__ */ jsx90(
|
|
58022
58166
|
Toolbar,
|
|
58023
58167
|
{
|
|
58024
58168
|
context: "simple",
|
|
@@ -58070,11 +58214,125 @@ function useMediaToken(id2) {
|
|
|
58070
58214
|
return { token, loading };
|
|
58071
58215
|
}
|
|
58072
58216
|
|
|
58073
|
-
// src/features/resource-viewer/
|
|
58074
|
-
|
|
58217
|
+
// src/features/resource-viewer/state/resource-viewer-page-state-unit.ts
|
|
58218
|
+
var import_rxjs2 = __toESM(require_cjs());
|
|
58219
|
+
import { createDisposer } from "@semiont/sdk";
|
|
58220
|
+
import { createBeckonStateUnit } from "@semiont/sdk";
|
|
58221
|
+
import { createMarkStateUnit } from "@semiont/sdk";
|
|
58222
|
+
import { createGatherStateUnit } from "@semiont/sdk";
|
|
58223
|
+
import { createMatchStateUnit } from "@semiont/sdk";
|
|
58224
|
+
import { createYieldStateUnit } from "@semiont/sdk";
|
|
58225
|
+
import { decodeWithCharset as decodeWithCharset2 } from "@semiont/core";
|
|
58226
|
+
import { isHighlight as isHighlight5, isComment as isComment5, isAssessment as isAssessment4, isReference as isReference6, isTag as isTag6 } from "@semiont/core";
|
|
58227
|
+
var WIZARD_CLOSED = {
|
|
58228
|
+
open: false,
|
|
58229
|
+
annotationId: null,
|
|
58230
|
+
resourceId: null,
|
|
58231
|
+
defaultTitle: "",
|
|
58232
|
+
entityTypes: []
|
|
58233
|
+
};
|
|
58234
|
+
function createResourceViewerPageStateUnit(client, resourceId2, locale, browse, options) {
|
|
58235
|
+
const disposer = createDisposer();
|
|
58236
|
+
const beckon = createBeckonStateUnit(client);
|
|
58237
|
+
const mark2 = createMarkStateUnit(client, resourceId2);
|
|
58238
|
+
const gather = createGatherStateUnit(client, resourceId2);
|
|
58239
|
+
const matchStateUnit = createMatchStateUnit(client, resourceId2);
|
|
58240
|
+
const yieldStateUnit = createYieldStateUnit(client, resourceId2, locale);
|
|
58241
|
+
disposer.add(beckon);
|
|
58242
|
+
disposer.add(browse);
|
|
58243
|
+
disposer.add(mark2);
|
|
58244
|
+
disposer.add(gather);
|
|
58245
|
+
disposer.add(matchStateUnit);
|
|
58246
|
+
disposer.add(yieldStateUnit);
|
|
58247
|
+
const annotations$ = client.browse.annotations(resourceId2).pipe(
|
|
58248
|
+
(0, import_rxjs2.map)((a15) => a15 ?? [])
|
|
58249
|
+
);
|
|
58250
|
+
const annotationGroups$ = annotations$.pipe(
|
|
58251
|
+
(0, import_rxjs2.map)((anns) => {
|
|
58252
|
+
const groups = { highlights: [], comments: [], assessments: [], references: [], tags: [] };
|
|
58253
|
+
for (const ann of anns) {
|
|
58254
|
+
if (isHighlight5(ann)) groups.highlights.push(ann);
|
|
58255
|
+
else if (isComment5(ann)) groups.comments.push(ann);
|
|
58256
|
+
else if (isAssessment4(ann)) groups.assessments.push(ann);
|
|
58257
|
+
else if (isReference6(ann)) groups.references.push(ann);
|
|
58258
|
+
else if (isTag6(ann)) groups.tags.push(ann);
|
|
58259
|
+
}
|
|
58260
|
+
return groups;
|
|
58261
|
+
})
|
|
58262
|
+
);
|
|
58263
|
+
const entityTypes$ = client.browse.entityTypes().pipe(
|
|
58264
|
+
(0, import_rxjs2.map)((e6) => e6 ?? [])
|
|
58265
|
+
);
|
|
58266
|
+
const events$ = client.browse.events(resourceId2).pipe(
|
|
58267
|
+
(0, import_rxjs2.map)((e6) => e6 ?? [])
|
|
58268
|
+
);
|
|
58269
|
+
const referencedBy$ = client.browse.referencedBy(resourceId2).pipe(
|
|
58270
|
+
(0, import_rxjs2.map)((r14) => r14 ?? [])
|
|
58271
|
+
);
|
|
58272
|
+
const content$ = new import_rxjs2.BehaviorSubject("");
|
|
58273
|
+
const contentLoading$ = new import_rxjs2.BehaviorSubject(false);
|
|
58274
|
+
const mediaToken$ = new import_rxjs2.BehaviorSubject(null);
|
|
58275
|
+
const mediaType = options?.mediaType || "text/plain";
|
|
58276
|
+
const isBinaryType = mediaType.startsWith("image/") || mediaType === "application/pdf";
|
|
58277
|
+
if (!isBinaryType && mediaType) {
|
|
58278
|
+
contentLoading$.next(true);
|
|
58279
|
+
client.browse.resourceRepresentation(resourceId2, { accept: mediaType }).then(({ data: data2 }) => {
|
|
58280
|
+
content$.next(decodeWithCharset2(data2, mediaType));
|
|
58281
|
+
contentLoading$.next(false);
|
|
58282
|
+
}).catch(() => {
|
|
58283
|
+
contentLoading$.next(false);
|
|
58284
|
+
});
|
|
58285
|
+
}
|
|
58286
|
+
if (isBinaryType) {
|
|
58287
|
+
client.auth.mediaToken(resourceId2).then(({ token }) => mediaToken$.next(token)).catch(() => {
|
|
58288
|
+
});
|
|
58289
|
+
}
|
|
58290
|
+
const wizard$ = new import_rxjs2.BehaviorSubject(WIZARD_CLOSED);
|
|
58291
|
+
const unsubscribeResource = client.subscribeToResource(resourceId2);
|
|
58292
|
+
disposer.add(unsubscribeResource);
|
|
58293
|
+
const bindInitiateSub = client.bus.get("bind:initiate").subscribe((event) => {
|
|
58294
|
+
wizard$.next({
|
|
58295
|
+
open: true,
|
|
58296
|
+
annotationId: event.annotationId,
|
|
58297
|
+
resourceId: event.resourceId,
|
|
58298
|
+
defaultTitle: event.defaultTitle,
|
|
58299
|
+
entityTypes: event.entityTypes
|
|
58300
|
+
});
|
|
58301
|
+
client.bus.get("gather:requested").next({
|
|
58302
|
+
correlationId: crypto.randomUUID(),
|
|
58303
|
+
annotationId: event.annotationId,
|
|
58304
|
+
resourceId: event.resourceId,
|
|
58305
|
+
options: { contextWindow: 2e3 }
|
|
58306
|
+
});
|
|
58307
|
+
});
|
|
58308
|
+
disposer.add(() => bindInitiateSub.unsubscribe());
|
|
58309
|
+
return {
|
|
58310
|
+
beckon,
|
|
58311
|
+
browse,
|
|
58312
|
+
mark: mark2,
|
|
58313
|
+
gather,
|
|
58314
|
+
yield: yieldStateUnit,
|
|
58315
|
+
annotations$,
|
|
58316
|
+
annotationGroups$,
|
|
58317
|
+
entityTypes$,
|
|
58318
|
+
events$,
|
|
58319
|
+
referencedBy$,
|
|
58320
|
+
content$: content$.asObservable(),
|
|
58321
|
+
contentLoading$: contentLoading$.asObservable(),
|
|
58322
|
+
mediaToken$: mediaToken$.asObservable(),
|
|
58323
|
+
wizard$: wizard$.asObservable(),
|
|
58324
|
+
closeWizard: () => wizard$.next(WIZARD_CLOSED),
|
|
58325
|
+
dispose: () => {
|
|
58326
|
+
wizard$.complete();
|
|
58327
|
+
content$.complete();
|
|
58328
|
+
contentLoading$.complete();
|
|
58329
|
+
mediaToken$.complete();
|
|
58330
|
+
disposer.dispose();
|
|
58331
|
+
}
|
|
58332
|
+
};
|
|
58333
|
+
}
|
|
58075
58334
|
|
|
58076
|
-
// src/hooks/
|
|
58077
|
-
import { createShellVM } from "@semiont/sdk";
|
|
58335
|
+
// src/hooks/useShellStateUnit.ts
|
|
58078
58336
|
function readPanel() {
|
|
58079
58337
|
if (typeof window === "undefined") return null;
|
|
58080
58338
|
const saved = localStorage.getItem("activeToolbarPanel");
|
|
@@ -58085,16 +58343,16 @@ function persistPanel(panel) {
|
|
|
58085
58343
|
if (panel) localStorage.setItem("activeToolbarPanel", panel);
|
|
58086
58344
|
else localStorage.removeItem("activeToolbarPanel");
|
|
58087
58345
|
}
|
|
58088
|
-
function
|
|
58346
|
+
function useShellStateUnit() {
|
|
58089
58347
|
const semiont = useSemiont();
|
|
58090
|
-
return
|
|
58348
|
+
return useStateUnit(() => createShellStateUnit(semiont, {
|
|
58091
58349
|
initialPanel: readPanel(),
|
|
58092
58350
|
onPanelChange: persistPanel
|
|
58093
58351
|
}));
|
|
58094
58352
|
}
|
|
58095
58353
|
|
|
58096
58354
|
// src/features/resource-viewer/components/ResourceViewerPage.tsx
|
|
58097
|
-
import { jsx as
|
|
58355
|
+
import { jsx as jsx91, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
58098
58356
|
function ResourceViewerPage({
|
|
58099
58357
|
resource,
|
|
58100
58358
|
rUri,
|
|
@@ -58122,47 +58380,51 @@ function ResourceViewerPage({
|
|
|
58122
58380
|
const binaryContent = isBinary && mediaToken && semiont ? `${semiont.baseUrl}/api/resources/${rUri}?token=${mediaToken}` : "";
|
|
58123
58381
|
const content4 = isBinary ? binaryContent : textContent;
|
|
58124
58382
|
const contentLoading = isBinary ? mediaTokenLoading : textLoading;
|
|
58125
|
-
const
|
|
58126
|
-
const
|
|
58127
|
-
const annotations = useObservable(
|
|
58128
|
-
const groups = useObservable(
|
|
58129
|
-
const allEntityTypes = useObservable(
|
|
58130
|
-
const referencedByRaw = useObservable(
|
|
58383
|
+
const browseStateUnit = useShellStateUnit();
|
|
58384
|
+
const stateUnit = useStateUnit(() => createResourceViewerPageStateUnit(semiont, rUri, locale, browseStateUnit));
|
|
58385
|
+
const annotations = useObservable(stateUnit.annotations$) ?? [];
|
|
58386
|
+
const groups = useObservable(stateUnit.annotationGroups$);
|
|
58387
|
+
const allEntityTypes = useObservable(stateUnit.entityTypes$) ?? [];
|
|
58388
|
+
const referencedByRaw = useObservable(stateUnit.referencedBy$);
|
|
58131
58389
|
const referencedBy = referencedByRaw ?? [];
|
|
58132
58390
|
const referencedByLoading = referencedByRaw === void 0;
|
|
58133
|
-
const hoveredAnnotationId = useObservable(
|
|
58134
|
-
const pendingAnnotation = useObservable(
|
|
58135
|
-
const assistingMotivation = useObservable(
|
|
58136
|
-
const progress = useObservable(
|
|
58137
|
-
const activePanel = useObservable(
|
|
58138
|
-
const scrollToAnnotationId = useObservable(
|
|
58139
|
-
const panelInitialTab = useObservable(
|
|
58140
|
-
const onScrollCompleted =
|
|
58141
|
-
const generationProgress = useObservable(
|
|
58142
|
-
const gatherContext = useObservable(
|
|
58143
|
-
const gatherLoading = useObservable(
|
|
58144
|
-
const gatherError = useObservable(
|
|
58145
|
-
const wizardState = useObservable(
|
|
58391
|
+
const hoveredAnnotationId = useObservable(stateUnit.beckon.hoveredAnnotationId$) ?? null;
|
|
58392
|
+
const pendingAnnotation = useObservable(stateUnit.mark.pendingAnnotation$) ?? null;
|
|
58393
|
+
const assistingMotivation = useObservable(stateUnit.mark.assistingMotivation$) ?? null;
|
|
58394
|
+
const progress = useObservable(stateUnit.mark.progress$) ?? null;
|
|
58395
|
+
const activePanel = useObservable(stateUnit.browse.activePanel$) ?? null;
|
|
58396
|
+
const scrollToAnnotationId = useObservable(stateUnit.browse.scrollToAnnotationId$) ?? null;
|
|
58397
|
+
const panelInitialTab = useObservable(stateUnit.browse.panelInitialTab$) ?? null;
|
|
58398
|
+
const onScrollCompleted = stateUnit.browse.onScrollCompleted;
|
|
58399
|
+
const generationProgress = useObservable(stateUnit.yield.progress$) ?? null;
|
|
58400
|
+
const gatherContext = useObservable(stateUnit.gather.context$) ?? null;
|
|
58401
|
+
const gatherLoading = useObservable(stateUnit.gather.loading$) ?? false;
|
|
58402
|
+
const gatherError = useObservable(stateUnit.gather.error$) ?? null;
|
|
58403
|
+
const wizardState = useObservable(stateUnit.wizard$);
|
|
58146
58404
|
const wizardOpen = wizardState?.open ?? false;
|
|
58147
58405
|
const wizardAnnotationId = wizardState?.annotationId ?? null;
|
|
58148
58406
|
const wizardResourceId = wizardState?.resourceId ?? null;
|
|
58149
58407
|
const wizardDefaultTitle = wizardState?.defaultTitle ?? "";
|
|
58150
58408
|
const wizardEntityTypes = wizardState?.entityTypes ?? [];
|
|
58151
58409
|
const handleWizardClose = useCallback34(() => {
|
|
58152
|
-
|
|
58153
|
-
}, [
|
|
58410
|
+
stateUnit.closeWizard();
|
|
58411
|
+
}, [stateUnit]);
|
|
58154
58412
|
const handleWizardGenerateSubmit = useCallback34((referenceId, config) => {
|
|
58155
58413
|
clearNewAnnotationId(annotationId(referenceId));
|
|
58156
|
-
|
|
58414
|
+
stateUnit.yield.generate(referenceId, {
|
|
58157
58415
|
title: config.title,
|
|
58158
58416
|
storageUri: config.storagePath,
|
|
58159
58417
|
prompt: config.prompt,
|
|
58160
58418
|
language: config.language,
|
|
58419
|
+
// The source resource is the one the user is viewing — fed into the
|
|
58420
|
+
// prompt so the LLM understands the embedded context (selected
|
|
58421
|
+
// passage, surrounding text) regardless of UI/target language.
|
|
58422
|
+
sourceLanguage: getLanguage(resource),
|
|
58161
58423
|
temperature: config.temperature,
|
|
58162
58424
|
maxTokens: config.maxTokens,
|
|
58163
58425
|
context: config.context
|
|
58164
58426
|
});
|
|
58165
|
-
}, [
|
|
58427
|
+
}, [stateUnit, clearNewAnnotationId, resource]);
|
|
58166
58428
|
const handleWizardLinkResource = useCallback34(async (referenceId, targetResourceId) => {
|
|
58167
58429
|
if (!semiont) return;
|
|
58168
58430
|
try {
|
|
@@ -58327,17 +58589,17 @@ function ResourceViewerPage({
|
|
|
58327
58589
|
}, [session]);
|
|
58328
58590
|
const handleEventClick = useCallback34((_annotationId) => {
|
|
58329
58591
|
}, []);
|
|
58330
|
-
return /* @__PURE__ */
|
|
58331
|
-
/* @__PURE__ */
|
|
58332
|
-
/* @__PURE__ */
|
|
58333
|
-
/* @__PURE__ */
|
|
58334
|
-
/* @__PURE__ */
|
|
58592
|
+
return /* @__PURE__ */ jsxs81("div", { className: `semiont-document-viewer${activePanel ? " semiont-document-viewer--panel-open" : ""}`, children: [
|
|
58593
|
+
/* @__PURE__ */ jsxs81("div", { className: "semiont-document-viewer__main", children: [
|
|
58594
|
+
/* @__PURE__ */ jsxs81("div", { className: "semiont-document-viewer__content", children: [
|
|
58595
|
+
/* @__PURE__ */ jsx91("div", { className: "semiont-document-viewer__header", children: /* @__PURE__ */ jsx91("div", { className: "semiont-document-viewer__header-inner", children: /* @__PURE__ */ jsx91("h2", { className: "semiont-document-viewer__title", children: resource.name }) }) }),
|
|
58596
|
+
/* @__PURE__ */ jsx91("div", { className: "semiont-document-viewer__scrollable-body", lang: getLanguage(resource) || void 0, children: /* @__PURE__ */ jsx91(
|
|
58335
58597
|
ErrorBoundary,
|
|
58336
58598
|
{
|
|
58337
|
-
fallback: (error, reset) => /* @__PURE__ */
|
|
58338
|
-
/* @__PURE__ */
|
|
58339
|
-
/* @__PURE__ */
|
|
58340
|
-
/* @__PURE__ */
|
|
58599
|
+
fallback: (error, reset) => /* @__PURE__ */ jsxs81("div", { className: "semiont-document-viewer__error", children: [
|
|
58600
|
+
/* @__PURE__ */ jsx91("h3", { className: "semiont-document-viewer__error-title", children: "Error loading document viewer" }),
|
|
58601
|
+
/* @__PURE__ */ jsx91("p", { className: "semiont-document-viewer__error-message", children: error.message }),
|
|
58602
|
+
/* @__PURE__ */ jsx91(
|
|
58341
58603
|
"button",
|
|
58342
58604
|
{
|
|
58343
58605
|
onClick: reset,
|
|
@@ -58346,7 +58608,7 @@ function ResourceViewerPage({
|
|
|
58346
58608
|
}
|
|
58347
58609
|
)
|
|
58348
58610
|
] }),
|
|
58349
|
-
children: contentLoading ? /* @__PURE__ */
|
|
58611
|
+
children: contentLoading ? /* @__PURE__ */ jsx91("div", { className: "semiont-document-viewer__loading", children: "Loading document content..." }) : /* @__PURE__ */ jsx91(
|
|
58350
58612
|
ResourceViewer,
|
|
58351
58613
|
{
|
|
58352
58614
|
resource: resourceWithContent,
|
|
@@ -58360,18 +58622,17 @@ function ResourceViewerPage({
|
|
|
58360
58622
|
}
|
|
58361
58623
|
) })
|
|
58362
58624
|
] }),
|
|
58363
|
-
/* @__PURE__ */
|
|
58364
|
-
/* @__PURE__ */
|
|
58625
|
+
/* @__PURE__ */ jsxs81("div", { className: "semiont-document-viewer__sidebar", children: [
|
|
58626
|
+
/* @__PURE__ */ jsxs81(
|
|
58365
58627
|
ToolbarPanels,
|
|
58366
58628
|
{
|
|
58367
58629
|
activePanel,
|
|
58368
58630
|
theme: theme2,
|
|
58369
58631
|
showLineNumbers,
|
|
58370
|
-
hoverDelayMs,
|
|
58371
58632
|
width: activePanel === "jsonld" ? "w-[600px]" : activePanel === "annotations" ? "w-[400px]" : "w-64",
|
|
58372
58633
|
children: [
|
|
58373
|
-
annotateMode && resource.archived && /* @__PURE__ */
|
|
58374
|
-
activePanel === "annotations" && !resource.archived && /* @__PURE__ */
|
|
58634
|
+
annotateMode && resource.archived && /* @__PURE__ */ jsx91("div", { className: "semiont-document-viewer__archived-status", children: /* @__PURE__ */ jsx91("div", { className: "semiont-document-viewer__archived-text", children: "\u{1F4E6} Archived" }) }),
|
|
58635
|
+
activePanel === "annotations" && !resource.archived && /* @__PURE__ */ jsx91(
|
|
58375
58636
|
UnifiedAnnotationsPanel,
|
|
58376
58637
|
{
|
|
58377
58638
|
annotations,
|
|
@@ -58386,6 +58647,7 @@ function ResourceViewerPage({
|
|
|
58386
58647
|
referencedByLoading,
|
|
58387
58648
|
resourceId: rUri,
|
|
58388
58649
|
locale,
|
|
58650
|
+
sourceLanguage: getLanguage(resource),
|
|
58389
58651
|
scrollToAnnotationId,
|
|
58390
58652
|
hoveredAnnotationId,
|
|
58391
58653
|
onScrollCompleted,
|
|
@@ -58395,7 +58657,7 @@ function ResourceViewerPage({
|
|
|
58395
58657
|
routes
|
|
58396
58658
|
}
|
|
58397
58659
|
),
|
|
58398
|
-
activePanel === "history" && /* @__PURE__ */
|
|
58660
|
+
activePanel === "history" && /* @__PURE__ */ jsx91(
|
|
58399
58661
|
AnnotationHistory,
|
|
58400
58662
|
{
|
|
58401
58663
|
rUri,
|
|
@@ -58406,7 +58668,7 @@ function ResourceViewerPage({
|
|
|
58406
58668
|
routes
|
|
58407
58669
|
}
|
|
58408
58670
|
),
|
|
58409
|
-
activePanel === "info" && /* @__PURE__ */
|
|
58671
|
+
activePanel === "info" && /* @__PURE__ */ jsx91(
|
|
58410
58672
|
ResourceInfoPanel,
|
|
58411
58673
|
{
|
|
58412
58674
|
resourceId: rUri,
|
|
@@ -58424,7 +58686,7 @@ function ResourceViewerPage({
|
|
|
58424
58686
|
generator: resource.generator
|
|
58425
58687
|
}
|
|
58426
58688
|
),
|
|
58427
|
-
activePanel === "collaboration" && /* @__PURE__ */
|
|
58689
|
+
activePanel === "collaboration" && /* @__PURE__ */ jsx91(
|
|
58428
58690
|
CollaborationPanel,
|
|
58429
58691
|
{
|
|
58430
58692
|
state: streamStatus,
|
|
@@ -58432,11 +58694,11 @@ function ResourceViewerPage({
|
|
|
58432
58694
|
knowledgeBaseName
|
|
58433
58695
|
}
|
|
58434
58696
|
),
|
|
58435
|
-
activePanel === "jsonld" && /* @__PURE__ */
|
|
58697
|
+
activePanel === "jsonld" && /* @__PURE__ */ jsx91(JsonLdPanel, { resource })
|
|
58436
58698
|
]
|
|
58437
58699
|
}
|
|
58438
58700
|
),
|
|
58439
|
-
/* @__PURE__ */
|
|
58701
|
+
/* @__PURE__ */ jsx91(
|
|
58440
58702
|
Toolbar,
|
|
58441
58703
|
{
|
|
58442
58704
|
context: "document",
|
|
@@ -58446,7 +58708,7 @@ function ResourceViewerPage({
|
|
|
58446
58708
|
)
|
|
58447
58709
|
] })
|
|
58448
58710
|
] }),
|
|
58449
|
-
/* @__PURE__ */
|
|
58711
|
+
/* @__PURE__ */ jsx91(
|
|
58450
58712
|
ReferenceWizardModal,
|
|
58451
58713
|
{
|
|
58452
58714
|
isOpen: wizardOpen,
|
|
@@ -58505,24 +58767,452 @@ function ResourceViewerPage({
|
|
|
58505
58767
|
}
|
|
58506
58768
|
|
|
58507
58769
|
// src/index.ts
|
|
58508
|
-
import {
|
|
58509
|
-
import {
|
|
58510
|
-
import {
|
|
58511
|
-
import {
|
|
58512
|
-
import {
|
|
58513
|
-
|
|
58514
|
-
|
|
58515
|
-
|
|
58516
|
-
|
|
58517
|
-
|
|
58518
|
-
|
|
58519
|
-
|
|
58520
|
-
|
|
58521
|
-
|
|
58522
|
-
|
|
58523
|
-
|
|
58524
|
-
|
|
58525
|
-
|
|
58770
|
+
import { createBeckonStateUnit as createBeckonStateUnit2, createHoverHandlers as createHoverHandlers4, HOVER_DELAY_MS as HOVER_DELAY_MS3 } from "@semiont/sdk";
|
|
58771
|
+
import { createMarkStateUnit as createMarkStateUnit2 } from "@semiont/sdk";
|
|
58772
|
+
import { createYieldStateUnit as createYieldStateUnit2 } from "@semiont/sdk";
|
|
58773
|
+
import { createGatherStateUnit as createGatherStateUnit2 } from "@semiont/sdk";
|
|
58774
|
+
import { createMatchStateUnit as createMatchStateUnit2 } from "@semiont/sdk";
|
|
58775
|
+
|
|
58776
|
+
// src/state/session-state-unit.ts
|
|
58777
|
+
var import_rxjs3 = __toESM(require_cjs());
|
|
58778
|
+
function createSessionStateUnit(client) {
|
|
58779
|
+
const isLoggingOut$ = new import_rxjs3.BehaviorSubject(false);
|
|
58780
|
+
const logout = async () => {
|
|
58781
|
+
isLoggingOut$.next(true);
|
|
58782
|
+
try {
|
|
58783
|
+
await client.auth.logout();
|
|
58784
|
+
} catch {
|
|
58785
|
+
} finally {
|
|
58786
|
+
isLoggingOut$.next(false);
|
|
58787
|
+
}
|
|
58788
|
+
};
|
|
58789
|
+
return {
|
|
58790
|
+
isLoggingOut$: isLoggingOut$.asObservable(),
|
|
58791
|
+
logout,
|
|
58792
|
+
dispose: () => {
|
|
58793
|
+
isLoggingOut$.complete();
|
|
58794
|
+
}
|
|
58795
|
+
};
|
|
58796
|
+
}
|
|
58797
|
+
|
|
58798
|
+
// src/features/resource-compose/state/compose-page-state-unit.ts
|
|
58799
|
+
var import_rxjs4 = __toESM(require_cjs());
|
|
58800
|
+
import { resourceId as makeResourceId2, annotationId as makeAnnotationId } from "@semiont/core";
|
|
58801
|
+
import { createDisposer as createDisposer2 } from "@semiont/sdk";
|
|
58802
|
+
import { getPrimaryMediaType as getPrimaryMediaType3, decodeWithCharset as decodeWithCharset3 } from "@semiont/core";
|
|
58803
|
+
function createComposePageStateUnit(client, browse, params, auth) {
|
|
58804
|
+
const disposer = createDisposer2();
|
|
58805
|
+
disposer.add(browse);
|
|
58806
|
+
const isReferenceMode = Boolean(params.annotationUri && params.sourceDocumentId && params.name);
|
|
58807
|
+
const isCloneMode = params.mode === "clone" && Boolean(params.token);
|
|
58808
|
+
const pageMode = isCloneMode ? "clone" : isReferenceMode ? "reference" : "new";
|
|
58809
|
+
const mode$ = new import_rxjs4.BehaviorSubject(pageMode);
|
|
58810
|
+
const loading$ = new import_rxjs4.BehaviorSubject(true);
|
|
58811
|
+
const cloneData$ = new import_rxjs4.BehaviorSubject(null);
|
|
58812
|
+
const referenceData$ = new import_rxjs4.BehaviorSubject(null);
|
|
58813
|
+
const gatheredContext$ = new import_rxjs4.BehaviorSubject(null);
|
|
58814
|
+
const uploadProgress$ = new import_rxjs4.BehaviorSubject(null);
|
|
58815
|
+
const entityTypes$ = client.browse.entityTypes().pipe(
|
|
58816
|
+
(0, import_rxjs4.map)((e6) => e6 ?? [])
|
|
58817
|
+
);
|
|
58818
|
+
if (isReferenceMode) {
|
|
58819
|
+
const entityTypes = params.entityTypes ? params.entityTypes.split(",") : [];
|
|
58820
|
+
referenceData$.next({
|
|
58821
|
+
annotationUri: params.annotationUri,
|
|
58822
|
+
sourceDocumentId: params.sourceDocumentId,
|
|
58823
|
+
name: params.name,
|
|
58824
|
+
entityTypes
|
|
58825
|
+
});
|
|
58826
|
+
if (params.storedContext) {
|
|
58827
|
+
try {
|
|
58828
|
+
gatheredContext$.next(JSON.parse(params.storedContext));
|
|
58829
|
+
} catch {
|
|
58830
|
+
}
|
|
58831
|
+
}
|
|
58832
|
+
loading$.next(false);
|
|
58833
|
+
} else if (isCloneMode) {
|
|
58834
|
+
void (async () => {
|
|
58835
|
+
try {
|
|
58836
|
+
const tokenResult = await client.yield.fromToken(params.token);
|
|
58837
|
+
if (tokenResult && auth) {
|
|
58838
|
+
const rId = makeResourceId2(tokenResult["@id"]);
|
|
58839
|
+
const mediaType = getPrimaryMediaType3(tokenResult) || "text/plain";
|
|
58840
|
+
const { data: data2 } = await client.browse.resourceRepresentation(rId, {
|
|
58841
|
+
accept: mediaType
|
|
58842
|
+
});
|
|
58843
|
+
const content4 = decodeWithCharset3(data2, mediaType);
|
|
58844
|
+
cloneData$.next({ sourceResource: tokenResult, sourceContent: content4 });
|
|
58845
|
+
}
|
|
58846
|
+
} catch {
|
|
58847
|
+
}
|
|
58848
|
+
loading$.next(false);
|
|
58849
|
+
})();
|
|
58850
|
+
} else {
|
|
58851
|
+
loading$.next(false);
|
|
58852
|
+
}
|
|
58853
|
+
const save = async (saveParams) => {
|
|
58854
|
+
if (saveParams.mode === "clone") {
|
|
58855
|
+
const response = await client.yield.createFromToken({
|
|
58856
|
+
token: params.token,
|
|
58857
|
+
name: saveParams.name,
|
|
58858
|
+
content: saveParams.content,
|
|
58859
|
+
archiveOriginal: saveParams.archiveOriginal ?? true
|
|
58860
|
+
});
|
|
58861
|
+
return response.resourceId;
|
|
58862
|
+
}
|
|
58863
|
+
let fileToUpload;
|
|
58864
|
+
let mimeType;
|
|
58865
|
+
if (saveParams.file) {
|
|
58866
|
+
fileToUpload = saveParams.file;
|
|
58867
|
+
mimeType = saveParams.format ?? "application/octet-stream";
|
|
58868
|
+
} else {
|
|
58869
|
+
const blob = new Blob([saveParams.content || ""], { type: saveParams.format ?? "application/octet-stream" });
|
|
58870
|
+
const extension2 = saveParams.format === "text/plain" ? ".txt" : saveParams.format === "text/html" ? ".html" : ".md";
|
|
58871
|
+
fileToUpload = new File([blob], saveParams.name + extension2, { type: saveParams.format ?? "application/octet-stream" });
|
|
58872
|
+
mimeType = saveParams.format ?? "application/octet-stream";
|
|
58873
|
+
}
|
|
58874
|
+
const format = saveParams.charset && !saveParams.file ? `${mimeType}; charset=${saveParams.charset}` : mimeType;
|
|
58875
|
+
const newResourceId = await new Promise((resolve, reject) => {
|
|
58876
|
+
client.yield.resource({
|
|
58877
|
+
name: saveParams.name,
|
|
58878
|
+
file: fileToUpload,
|
|
58879
|
+
format,
|
|
58880
|
+
entityTypes: saveParams.entityTypes || [],
|
|
58881
|
+
language: saveParams.language,
|
|
58882
|
+
creationMethod: "ui",
|
|
58883
|
+
storageUri: saveParams.storageUri
|
|
58884
|
+
}).subscribe({
|
|
58885
|
+
next: (event) => {
|
|
58886
|
+
uploadProgress$.next(event);
|
|
58887
|
+
if (event.phase === "finished") resolve(event.resourceId);
|
|
58888
|
+
},
|
|
58889
|
+
error: (err) => {
|
|
58890
|
+
uploadProgress$.next(null);
|
|
58891
|
+
reject(err);
|
|
58892
|
+
},
|
|
58893
|
+
complete: () => uploadProgress$.next(null)
|
|
58894
|
+
});
|
|
58895
|
+
});
|
|
58896
|
+
if (saveParams.mode === "reference" && saveParams.annotationUri && saveParams.sourceDocumentId) {
|
|
58897
|
+
await client.bind.body(
|
|
58898
|
+
makeResourceId2(saveParams.sourceDocumentId),
|
|
58899
|
+
makeAnnotationId(saveParams.annotationUri),
|
|
58900
|
+
[{ op: "add", item: { type: "SpecificResource", source: newResourceId, purpose: "linking" } }]
|
|
58901
|
+
);
|
|
58902
|
+
}
|
|
58903
|
+
return newResourceId;
|
|
58904
|
+
};
|
|
58905
|
+
return {
|
|
58906
|
+
browse,
|
|
58907
|
+
mode$: mode$.asObservable(),
|
|
58908
|
+
loading$: loading$.asObservable(),
|
|
58909
|
+
cloneData$: cloneData$.asObservable(),
|
|
58910
|
+
referenceData$: referenceData$.asObservable(),
|
|
58911
|
+
gatheredContext$: gatheredContext$.asObservable(),
|
|
58912
|
+
entityTypes$,
|
|
58913
|
+
uploadProgress$: uploadProgress$.asObservable(),
|
|
58914
|
+
save,
|
|
58915
|
+
dispose: () => {
|
|
58916
|
+
mode$.complete();
|
|
58917
|
+
loading$.complete();
|
|
58918
|
+
cloneData$.complete();
|
|
58919
|
+
referenceData$.complete();
|
|
58920
|
+
gatheredContext$.complete();
|
|
58921
|
+
disposer.dispose();
|
|
58922
|
+
}
|
|
58923
|
+
};
|
|
58924
|
+
}
|
|
58925
|
+
|
|
58926
|
+
// src/features/resource-viewer/state/resource-loader-state-unit.ts
|
|
58927
|
+
var import_rxjs5 = __toESM(require_cjs());
|
|
58928
|
+
function createResourceLoaderStateUnit(client, resourceId2) {
|
|
58929
|
+
const raw$ = client.browse.resource(resourceId2);
|
|
58930
|
+
const resource$ = raw$;
|
|
58931
|
+
const isLoading$ = raw$.pipe((0, import_rxjs5.map)((r14) => r14 === void 0));
|
|
58932
|
+
return {
|
|
58933
|
+
resource$,
|
|
58934
|
+
isLoading$,
|
|
58935
|
+
invalidate: () => client.browse.invalidateResourceDetail(resourceId2),
|
|
58936
|
+
dispose: () => {
|
|
58937
|
+
}
|
|
58938
|
+
};
|
|
58939
|
+
}
|
|
58940
|
+
|
|
58941
|
+
// src/features/admin-users/state/admin-users-state-unit.ts
|
|
58942
|
+
var import_rxjs6 = __toESM(require_cjs());
|
|
58943
|
+
import { userDID } from "@semiont/core";
|
|
58944
|
+
import { createDisposer as createDisposer3 } from "@semiont/sdk";
|
|
58945
|
+
function createAdminUsersStateUnit(client, browse) {
|
|
58946
|
+
const disposer = createDisposer3();
|
|
58947
|
+
disposer.add(browse);
|
|
58948
|
+
const users$ = new import_rxjs6.BehaviorSubject([]);
|
|
58949
|
+
const stats$ = new import_rxjs6.BehaviorSubject(null);
|
|
58950
|
+
const usersLoading$ = new import_rxjs6.BehaviorSubject(true);
|
|
58951
|
+
const statsLoading$ = new import_rxjs6.BehaviorSubject(true);
|
|
58952
|
+
const fetchUsers = () => {
|
|
58953
|
+
usersLoading$.next(true);
|
|
58954
|
+
client.admin.users().then((data2) => {
|
|
58955
|
+
users$.next(data2.users ?? []);
|
|
58956
|
+
usersLoading$.next(false);
|
|
58957
|
+
}).catch(() => usersLoading$.next(false));
|
|
58958
|
+
};
|
|
58959
|
+
const fetchStats = () => {
|
|
58960
|
+
statsLoading$.next(true);
|
|
58961
|
+
client.admin.userStats().then((data2) => {
|
|
58962
|
+
stats$.next(data2.stats ?? null);
|
|
58963
|
+
statsLoading$.next(false);
|
|
58964
|
+
}).catch(() => statsLoading$.next(false));
|
|
58965
|
+
};
|
|
58966
|
+
fetchUsers();
|
|
58967
|
+
fetchStats();
|
|
58968
|
+
const updateUser = async (id2, data2) => {
|
|
58969
|
+
await client.admin.updateUser(userDID(id2), data2);
|
|
58970
|
+
fetchUsers();
|
|
58971
|
+
fetchStats();
|
|
58972
|
+
};
|
|
58973
|
+
return {
|
|
58974
|
+
browse,
|
|
58975
|
+
users$: users$.asObservable(),
|
|
58976
|
+
stats$: stats$.asObservable(),
|
|
58977
|
+
usersLoading$: usersLoading$.asObservable(),
|
|
58978
|
+
statsLoading$: statsLoading$.asObservable(),
|
|
58979
|
+
updateUser,
|
|
58980
|
+
dispose: () => {
|
|
58981
|
+
users$.complete();
|
|
58982
|
+
stats$.complete();
|
|
58983
|
+
usersLoading$.complete();
|
|
58984
|
+
statsLoading$.complete();
|
|
58985
|
+
disposer.dispose();
|
|
58986
|
+
}
|
|
58987
|
+
};
|
|
58988
|
+
}
|
|
58989
|
+
|
|
58990
|
+
// src/features/admin-security/state/admin-security-state-unit.ts
|
|
58991
|
+
var import_rxjs7 = __toESM(require_cjs());
|
|
58992
|
+
import { createDisposer as createDisposer4 } from "@semiont/sdk";
|
|
58993
|
+
function createAdminSecurityStateUnit(client, browse) {
|
|
58994
|
+
const disposer = createDisposer4();
|
|
58995
|
+
disposer.add(browse);
|
|
58996
|
+
const providers$ = new import_rxjs7.BehaviorSubject([]);
|
|
58997
|
+
const allowedDomains$ = new import_rxjs7.BehaviorSubject([]);
|
|
58998
|
+
const isLoading$ = new import_rxjs7.BehaviorSubject(true);
|
|
58999
|
+
client.admin.oauthConfig().then((data2) => {
|
|
59000
|
+
const config = data2;
|
|
59001
|
+
providers$.next(config.providers ?? []);
|
|
59002
|
+
allowedDomains$.next(config.allowedDomains ?? []);
|
|
59003
|
+
isLoading$.next(false);
|
|
59004
|
+
}).catch(() => isLoading$.next(false));
|
|
59005
|
+
return {
|
|
59006
|
+
browse,
|
|
59007
|
+
providers$: providers$.asObservable(),
|
|
59008
|
+
allowedDomains$: allowedDomains$.asObservable(),
|
|
59009
|
+
isLoading$: isLoading$.asObservable(),
|
|
59010
|
+
dispose: () => {
|
|
59011
|
+
providers$.complete();
|
|
59012
|
+
allowedDomains$.complete();
|
|
59013
|
+
isLoading$.complete();
|
|
59014
|
+
disposer.dispose();
|
|
59015
|
+
}
|
|
59016
|
+
};
|
|
59017
|
+
}
|
|
59018
|
+
|
|
59019
|
+
// src/features/admin-exchange/state/exchange-state-unit.ts
|
|
59020
|
+
var import_rxjs8 = __toESM(require_cjs());
|
|
59021
|
+
var import_operators3 = __toESM(require_operators());
|
|
59022
|
+
import { createDisposer as createDisposer5 } from "@semiont/sdk";
|
|
59023
|
+
function createExchangeStateUnit(browse, exportFn, importFn) {
|
|
59024
|
+
const disposer = createDisposer5();
|
|
59025
|
+
disposer.add(browse);
|
|
59026
|
+
const selectedFile$ = new import_rxjs8.BehaviorSubject(null);
|
|
59027
|
+
const preview$ = new import_rxjs8.BehaviorSubject(null);
|
|
59028
|
+
const importPhase$ = new import_rxjs8.BehaviorSubject(null);
|
|
59029
|
+
const importMessage$ = new import_rxjs8.BehaviorSubject(void 0);
|
|
59030
|
+
const importResult$ = new import_rxjs8.BehaviorSubject(void 0);
|
|
59031
|
+
const isExporting$ = new import_rxjs8.BehaviorSubject(false);
|
|
59032
|
+
const isImporting$ = new import_rxjs8.BehaviorSubject(false);
|
|
59033
|
+
const selectFile = (file) => {
|
|
59034
|
+
selectedFile$.next(file);
|
|
59035
|
+
importPhase$.next(null);
|
|
59036
|
+
importMessage$.next(void 0);
|
|
59037
|
+
importResult$.next(void 0);
|
|
59038
|
+
preview$.next({
|
|
59039
|
+
format: file.name.endsWith(".tar.gz") || file.name.endsWith(".gz") ? "semiont-linked-data" : "unknown",
|
|
59040
|
+
version: 1,
|
|
59041
|
+
sourceUrl: "",
|
|
59042
|
+
stats: {}
|
|
59043
|
+
});
|
|
59044
|
+
};
|
|
59045
|
+
const cancelImport = () => {
|
|
59046
|
+
selectedFile$.next(null);
|
|
59047
|
+
preview$.next(null);
|
|
59048
|
+
importPhase$.next(null);
|
|
59049
|
+
importMessage$.next(void 0);
|
|
59050
|
+
importResult$.next(void 0);
|
|
59051
|
+
};
|
|
59052
|
+
const doExport = async () => {
|
|
59053
|
+
isExporting$.next(true);
|
|
59054
|
+
try {
|
|
59055
|
+
const download = await exportFn();
|
|
59056
|
+
const blob = await new Response(download.stream).blob();
|
|
59057
|
+
const filename = download.filename ?? `semiont-export-${Date.now()}.tar.gz`;
|
|
59058
|
+
return { blob, filename };
|
|
59059
|
+
} finally {
|
|
59060
|
+
isExporting$.next(false);
|
|
59061
|
+
}
|
|
59062
|
+
};
|
|
59063
|
+
const doImport = async () => {
|
|
59064
|
+
const file = selectedFile$.getValue();
|
|
59065
|
+
if (!file) return;
|
|
59066
|
+
isImporting$.next(true);
|
|
59067
|
+
importPhase$.next("started");
|
|
59068
|
+
importMessage$.next(void 0);
|
|
59069
|
+
importResult$.next(void 0);
|
|
59070
|
+
try {
|
|
59071
|
+
await (0, import_rxjs8.lastValueFrom)(
|
|
59072
|
+
importFn(file).pipe(
|
|
59073
|
+
(0, import_operators3.tap)((event) => {
|
|
59074
|
+
importPhase$.next(event.phase);
|
|
59075
|
+
importMessage$.next(event.message);
|
|
59076
|
+
if (event.result) importResult$.next(event.result);
|
|
59077
|
+
})
|
|
59078
|
+
)
|
|
59079
|
+
);
|
|
59080
|
+
} finally {
|
|
59081
|
+
isImporting$.next(false);
|
|
59082
|
+
}
|
|
59083
|
+
};
|
|
59084
|
+
return {
|
|
59085
|
+
browse,
|
|
59086
|
+
selectedFile$: selectedFile$.asObservable(),
|
|
59087
|
+
preview$: preview$.asObservable(),
|
|
59088
|
+
importPhase$: importPhase$.asObservable(),
|
|
59089
|
+
importMessage$: importMessage$.asObservable(),
|
|
59090
|
+
importResult$: importResult$.asObservable(),
|
|
59091
|
+
isExporting$: isExporting$.asObservable(),
|
|
59092
|
+
isImporting$: isImporting$.asObservable(),
|
|
59093
|
+
selectFile,
|
|
59094
|
+
cancelImport,
|
|
59095
|
+
doExport,
|
|
59096
|
+
doImport,
|
|
59097
|
+
dispose: () => {
|
|
59098
|
+
selectedFile$.complete();
|
|
59099
|
+
preview$.complete();
|
|
59100
|
+
importPhase$.complete();
|
|
59101
|
+
importMessage$.complete();
|
|
59102
|
+
importResult$.complete();
|
|
59103
|
+
isExporting$.complete();
|
|
59104
|
+
isImporting$.complete();
|
|
59105
|
+
disposer.dispose();
|
|
59106
|
+
}
|
|
59107
|
+
};
|
|
59108
|
+
}
|
|
59109
|
+
|
|
59110
|
+
// src/features/auth-welcome/state/welcome-state-unit.ts
|
|
59111
|
+
var import_rxjs9 = __toESM(require_cjs());
|
|
59112
|
+
import { createDisposer as createDisposer6 } from "@semiont/sdk";
|
|
59113
|
+
function createWelcomeStateUnit(client) {
|
|
59114
|
+
const disposer = createDisposer6();
|
|
59115
|
+
const userData$ = new import_rxjs9.BehaviorSubject(null);
|
|
59116
|
+
const isProcessing$ = new import_rxjs9.BehaviorSubject(false);
|
|
59117
|
+
client.auth.me().then((data2) => userData$.next(data2)).catch(() => {
|
|
59118
|
+
});
|
|
59119
|
+
const acceptTerms = async () => {
|
|
59120
|
+
isProcessing$.next(true);
|
|
59121
|
+
try {
|
|
59122
|
+
await client.auth.acceptTerms();
|
|
59123
|
+
userData$.next({ ...userData$.getValue(), termsAcceptedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
59124
|
+
} finally {
|
|
59125
|
+
isProcessing$.next(false);
|
|
59126
|
+
}
|
|
59127
|
+
};
|
|
59128
|
+
return {
|
|
59129
|
+
userData$: userData$.asObservable(),
|
|
59130
|
+
isProcessing$: isProcessing$.asObservable(),
|
|
59131
|
+
acceptTerms,
|
|
59132
|
+
dispose: () => {
|
|
59133
|
+
userData$.complete();
|
|
59134
|
+
isProcessing$.complete();
|
|
59135
|
+
disposer.dispose();
|
|
59136
|
+
}
|
|
59137
|
+
};
|
|
59138
|
+
}
|
|
59139
|
+
|
|
59140
|
+
// src/features/resource-discovery/state/discover-state-unit.ts
|
|
59141
|
+
var import_rxjs10 = __toESM(require_cjs());
|
|
59142
|
+
import { createDisposer as createDisposer7 } from "@semiont/sdk";
|
|
59143
|
+
import { createSearchPipeline as createSearchPipeline3 } from "@semiont/sdk";
|
|
59144
|
+
var RECENT_LIMIT = 10;
|
|
59145
|
+
var SEARCH_LIMIT3 = 20;
|
|
59146
|
+
function createDiscoverStateUnit(client, browse) {
|
|
59147
|
+
const disposer = createDisposer7();
|
|
59148
|
+
const search2 = createSearchPipeline3(
|
|
59149
|
+
(q2) => client.browse.resources({ search: q2, limit: SEARCH_LIMIT3 })
|
|
59150
|
+
);
|
|
59151
|
+
disposer.add(search2);
|
|
59152
|
+
disposer.add(browse);
|
|
59153
|
+
const recent$ = client.browse.resources({ limit: RECENT_LIMIT, archived: false });
|
|
59154
|
+
const recentResources$ = recent$.pipe(
|
|
59155
|
+
(0, import_rxjs10.map)((r14) => r14 ?? [])
|
|
59156
|
+
);
|
|
59157
|
+
const isLoadingRecent$ = recent$.pipe(
|
|
59158
|
+
(0, import_rxjs10.map)((r14) => r14 === void 0)
|
|
59159
|
+
);
|
|
59160
|
+
const entityTypes$ = client.browse.entityTypes().pipe(
|
|
59161
|
+
(0, import_rxjs10.map)((e6) => e6 ?? [])
|
|
59162
|
+
);
|
|
59163
|
+
return {
|
|
59164
|
+
browse,
|
|
59165
|
+
search: search2,
|
|
59166
|
+
recentResources$,
|
|
59167
|
+
entityTypes$,
|
|
59168
|
+
isLoadingRecent$,
|
|
59169
|
+
dispose: () => disposer.dispose()
|
|
59170
|
+
};
|
|
59171
|
+
}
|
|
59172
|
+
|
|
59173
|
+
// src/features/moderate-entity-tags/state/entity-tags-state-unit.ts
|
|
59174
|
+
var import_rxjs11 = __toESM(require_cjs());
|
|
59175
|
+
import { createDisposer as createDisposer8 } from "@semiont/sdk";
|
|
59176
|
+
function createEntityTagsStateUnit(client, browse) {
|
|
59177
|
+
const disposer = createDisposer8();
|
|
59178
|
+
disposer.add(browse);
|
|
59179
|
+
const newTag$ = new import_rxjs11.BehaviorSubject("");
|
|
59180
|
+
const error$ = new import_rxjs11.BehaviorSubject("");
|
|
59181
|
+
const isAdding$ = new import_rxjs11.BehaviorSubject(false);
|
|
59182
|
+
const raw$ = client.browse.entityTypes();
|
|
59183
|
+
const entityTypes$ = raw$.pipe((0, import_rxjs11.map)((e6) => e6 ?? []));
|
|
59184
|
+
const isLoading$ = raw$.pipe((0, import_rxjs11.map)((e6) => e6 === void 0));
|
|
59185
|
+
const addTag = async () => {
|
|
59186
|
+
const tag = newTag$.getValue().trim();
|
|
59187
|
+
if (!tag) return;
|
|
59188
|
+
error$.next("");
|
|
59189
|
+
isAdding$.next(true);
|
|
59190
|
+
try {
|
|
59191
|
+
await client.frame.addEntityType(tag);
|
|
59192
|
+
newTag$.next("");
|
|
59193
|
+
} catch (err) {
|
|
59194
|
+
error$.next(err instanceof Error ? err.message : "Failed to add entity type");
|
|
59195
|
+
} finally {
|
|
59196
|
+
isAdding$.next(false);
|
|
59197
|
+
}
|
|
59198
|
+
};
|
|
59199
|
+
return {
|
|
59200
|
+
browse,
|
|
59201
|
+
entityTypes$,
|
|
59202
|
+
isLoading$,
|
|
59203
|
+
newTag$: newTag$.asObservable(),
|
|
59204
|
+
error$: error$.asObservable(),
|
|
59205
|
+
isAdding$: isAdding$.asObservable(),
|
|
59206
|
+
setNewTag: (v4) => newTag$.next(v4),
|
|
59207
|
+
addTag,
|
|
59208
|
+
dispose: () => {
|
|
59209
|
+
newTag$.complete();
|
|
59210
|
+
error$.complete();
|
|
59211
|
+
isAdding$.complete();
|
|
59212
|
+
disposer.dispose();
|
|
59213
|
+
}
|
|
59214
|
+
};
|
|
59215
|
+
}
|
|
58526
59216
|
export {
|
|
58527
59217
|
ANNOTATORS,
|
|
58528
59218
|
AVAILABLE_LOCALES,
|
|
@@ -58544,7 +59234,7 @@ export {
|
|
|
58544
59234
|
BrowseView,
|
|
58545
59235
|
Button,
|
|
58546
59236
|
ButtonGroup,
|
|
58547
|
-
|
|
59237
|
+
COMMON_PANELS,
|
|
58548
59238
|
CodeMirrorRenderer,
|
|
58549
59239
|
CollaborationPanel,
|
|
58550
59240
|
CollapsibleResourceNavigation,
|
|
@@ -58625,6 +59315,7 @@ export {
|
|
|
58625
59315
|
TranslationProvider,
|
|
58626
59316
|
UnifiedAnnotationsPanel,
|
|
58627
59317
|
UnifiedHeader,
|
|
59318
|
+
UploadProgressBar,
|
|
58628
59319
|
UserMenuSkeleton,
|
|
58629
59320
|
WebBrowserStorage,
|
|
58630
59321
|
WelcomePage,
|
|
@@ -58633,26 +59324,24 @@ export {
|
|
|
58633
59324
|
buildTextNodeIndex,
|
|
58634
59325
|
buttonStyles,
|
|
58635
59326
|
clearHighlights,
|
|
58636
|
-
|
|
58637
|
-
|
|
58638
|
-
|
|
58639
|
-
|
|
58640
|
-
|
|
58641
|
-
|
|
58642
|
-
|
|
58643
|
-
|
|
59327
|
+
createAdminSecurityStateUnit,
|
|
59328
|
+
createAdminUsersStateUnit,
|
|
59329
|
+
createBeckonStateUnit2 as createBeckonStateUnit,
|
|
59330
|
+
createComposePageStateUnit,
|
|
59331
|
+
createDiscoverStateUnit,
|
|
59332
|
+
createEntityTagsStateUnit,
|
|
59333
|
+
createExchangeStateUnit,
|
|
59334
|
+
createGatherStateUnit2 as createGatherStateUnit,
|
|
58644
59335
|
createHoverHandlers4 as createHoverHandlers,
|
|
58645
|
-
|
|
58646
|
-
|
|
58647
|
-
|
|
58648
|
-
|
|
58649
|
-
|
|
58650
|
-
|
|
58651
|
-
|
|
58652
|
-
|
|
58653
|
-
|
|
58654
|
-
createWelcomeVM,
|
|
58655
|
-
createYieldVM,
|
|
59336
|
+
createMarkStateUnit2 as createMarkStateUnit,
|
|
59337
|
+
createMatchStateUnit2 as createMatchStateUnit,
|
|
59338
|
+
createResourceLoaderStateUnit,
|
|
59339
|
+
createResourceViewerPageStateUnit,
|
|
59340
|
+
createSearchPipeline4 as createSearchPipeline,
|
|
59341
|
+
createSessionStateUnit,
|
|
59342
|
+
createShellStateUnit,
|
|
59343
|
+
createWelcomeStateUnit,
|
|
59344
|
+
createYieldStateUnit2 as createYieldStateUnit,
|
|
58656
59345
|
cssVariables,
|
|
58657
59346
|
faviconPaths,
|
|
58658
59347
|
formatTime,
|
|
@@ -58708,10 +59397,10 @@ export {
|
|
|
58708
59397
|
useSearchAnnouncements,
|
|
58709
59398
|
useSemiont,
|
|
58710
59399
|
useSessionExpiry,
|
|
58711
|
-
|
|
59400
|
+
useShellStateUnit,
|
|
59401
|
+
useStateUnit,
|
|
58712
59402
|
useTheme,
|
|
58713
59403
|
useToast,
|
|
58714
|
-
useTranslations
|
|
58715
|
-
useViewModel
|
|
59404
|
+
useTranslations
|
|
58716
59405
|
};
|
|
58717
59406
|
//# sourceMappingURL=index.mjs.map
|