@arbidocs/react 0.5.15 → 0.5.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/annotations/freeze/index.cjs +15 -15
- package/dist/annotations/freeze/index.js +3 -3
- package/dist/annotations/index.cjs +56 -56
- package/dist/annotations/index.d.cts +0 -1
- package/dist/annotations/index.d.ts +0 -1
- package/dist/annotations/index.js +2 -2
- package/dist/artifacts/index.cjs +2 -2
- package/dist/artifacts/index.js +1 -1
- package/dist/bundle-4TKU5WEQ.js +5 -0
- package/dist/{bundle-HFDCTQCK.js.map → bundle-4TKU5WEQ.js.map} +1 -1
- package/dist/bundle-B5AN4B7H.cjs +14 -0
- package/dist/{bundle-MRZK7HWU.cjs.map → bundle-B5AN4B7H.cjs.map} +1 -1
- package/dist/calls/livekit/index.cjs +41 -41
- package/dist/calls/livekit/index.js +2 -2
- package/dist/{chunk-S33P6THG.js → chunk-2XMHFQ7M.js} +3 -3
- package/dist/{chunk-S33P6THG.js.map → chunk-2XMHFQ7M.js.map} +1 -1
- package/dist/{chunk-BXR5WEQ3.cjs → chunk-4VQ3XHAQ.cjs} +5 -5
- package/dist/chunk-4VQ3XHAQ.cjs.map +1 -0
- package/dist/{chunk-RDF2Q45F.cjs → chunk-ALLWAYMB.cjs} +20 -20
- package/dist/{chunk-RDF2Q45F.cjs.map → chunk-ALLWAYMB.cjs.map} +1 -1
- package/dist/{chunk-36NAB4FC.cjs → chunk-CNRF5SLZ.cjs} +9 -3
- package/dist/chunk-CNRF5SLZ.cjs.map +1 -0
- package/dist/{chunk-R4RVHP6T.js → chunk-D63FAYES.js} +3 -3
- package/dist/chunk-D63FAYES.js.map +1 -0
- package/dist/{chunk-WA4NBJ6Q.cjs → chunk-EYOXZHXM.cjs} +7 -7
- package/dist/chunk-EYOXZHXM.cjs.map +1 -0
- package/dist/{chunk-WHBDSNXO.js → chunk-GUCQMP6G.js} +3 -3
- package/dist/chunk-GUCQMP6G.js.map +1 -0
- package/dist/{chunk-5WVXYOGX.js → chunk-J2GERLMU.js} +9 -4
- package/dist/chunk-J2GERLMU.js.map +1 -0
- package/dist/{chunk-LRBOMQ6Q.cjs → chunk-NSSGDZSL.cjs} +2 -2
- package/dist/{chunk-LRBOMQ6Q.cjs.map → chunk-NSSGDZSL.cjs.map} +1 -1
- package/dist/{chunk-NBIW7AEE.js → chunk-XTWUMTCQ.js} +2 -2
- package/dist/{chunk-NBIW7AEE.js.map → chunk-XTWUMTCQ.js.map} +1 -1
- package/dist/document-tools/index.cjs +11 -11
- package/dist/document-tools/index.cjs.map +1 -1
- package/dist/document-tools/index.js +3 -3
- package/dist/document-tools/index.js.map +1 -1
- package/dist/index.cjs +420 -364
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +72 -1
- package/dist/index.d.ts +72 -1
- package/dist/index.js +51 -5
- package/dist/index.js.map +1 -1
- package/dist/viewers/index.cjs.map +1 -1
- package/dist/viewers/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/bundle-HFDCTQCK.js +0 -5
- package/dist/bundle-MRZK7HWU.cjs +0 -14
- package/dist/chunk-36NAB4FC.cjs.map +0 -1
- package/dist/chunk-5WVXYOGX.js.map +0 -1
- package/dist/chunk-BXR5WEQ3.cjs.map +0 -1
- package/dist/chunk-R4RVHP6T.js.map +0 -1
- package/dist/chunk-WA4NBJ6Q.cjs.map +0 -1
- package/dist/chunk-WHBDSNXO.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkNSSGDZSL_cjs = require('./chunk-NSSGDZSL.cjs');
|
|
4
4
|
var chunkWYZJLZ67_cjs = require('./chunk-WYZJLZ67.cjs');
|
|
5
5
|
var chunkHJDR5HEO_cjs = require('./chunk-HJDR5HEO.cjs');
|
|
6
6
|
var chunkS6A6FSG7_cjs = require('./chunk-S6A6FSG7.cjs');
|
|
@@ -18,7 +18,7 @@ function reduceLayer(layer, action) {
|
|
|
18
18
|
case "replaceAll":
|
|
19
19
|
return action.layer;
|
|
20
20
|
case "add": {
|
|
21
|
-
const annotation =
|
|
21
|
+
const annotation = chunkNSSGDZSL_cjs.parseAnnotation(action.annotation);
|
|
22
22
|
if (layer.annotations.some((a) => a.id === annotation.id)) {
|
|
23
23
|
throw new Error(`annotation ${annotation.id} already exists`);
|
|
24
24
|
}
|
|
@@ -37,7 +37,7 @@ function reduceLayer(layer, action) {
|
|
|
37
37
|
case "update": {
|
|
38
38
|
const found = layer.annotations.find((a) => a.id === action.id);
|
|
39
39
|
if (!found) return layer;
|
|
40
|
-
const next =
|
|
40
|
+
const next = chunkNSSGDZSL_cjs.parseAnnotation({
|
|
41
41
|
...found,
|
|
42
42
|
...action.patch,
|
|
43
43
|
id: found.id,
|
|
@@ -76,7 +76,7 @@ function reduceLayer(layer, action) {
|
|
|
76
76
|
case "reply": {
|
|
77
77
|
const found = layer.annotations.find((a) => a.id === action.id);
|
|
78
78
|
if (!found || found.kind !== "comment") return layer;
|
|
79
|
-
const next =
|
|
79
|
+
const next = chunkNSSGDZSL_cjs.parseAnnotation({
|
|
80
80
|
...found,
|
|
81
81
|
replies: [...found.replies, action.reply],
|
|
82
82
|
updatedAt: action.now
|
|
@@ -146,10 +146,10 @@ function createMemoryStore(now = () => (/* @__PURE__ */ new Date()).toISOString(
|
|
|
146
146
|
return {
|
|
147
147
|
async load(documentId) {
|
|
148
148
|
const raw = layers.get(documentId);
|
|
149
|
-
return raw ?
|
|
149
|
+
return raw ? chunkNSSGDZSL_cjs.parseLayer(JSON.parse(raw)) : chunkNSSGDZSL_cjs.emptyLayer(documentId, now());
|
|
150
150
|
},
|
|
151
151
|
async save(layer) {
|
|
152
|
-
layers.set(layer.documentId, JSON.stringify(
|
|
152
|
+
layers.set(layer.documentId, JSON.stringify(chunkNSSGDZSL_cjs.parseLayer(layer)));
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
155
|
}
|
|
@@ -159,14 +159,14 @@ function createLocalStorageStore(storage = safeLocalStorage(), now = () => (/* @
|
|
|
159
159
|
async load(documentId) {
|
|
160
160
|
try {
|
|
161
161
|
const raw = storage?.getItem(STORAGE_PREFIX + documentId);
|
|
162
|
-
if (raw) return
|
|
162
|
+
if (raw) return chunkNSSGDZSL_cjs.parseLayer(JSON.parse(raw));
|
|
163
163
|
} catch {
|
|
164
164
|
}
|
|
165
|
-
return
|
|
165
|
+
return chunkNSSGDZSL_cjs.emptyLayer(documentId, now());
|
|
166
166
|
},
|
|
167
167
|
async save(layer) {
|
|
168
168
|
if (!storage) throw new Error("storage is not available");
|
|
169
|
-
storage.setItem(STORAGE_PREFIX + layer.documentId, JSON.stringify(
|
|
169
|
+
storage.setItem(STORAGE_PREFIX + layer.documentId, JSON.stringify(chunkNSSGDZSL_cjs.parseLayer(layer)));
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
172
|
}
|
|
@@ -269,7 +269,7 @@ function toNorm(r, page) {
|
|
|
269
269
|
const cy1 = Math.min(Math.max(y1, 0), page.height);
|
|
270
270
|
const cx2 = Math.min(Math.max(x2, 0), page.width);
|
|
271
271
|
const cy2 = Math.min(Math.max(y2, 0), page.height);
|
|
272
|
-
return
|
|
272
|
+
return chunkNSSGDZSL_cjs.clampRect({
|
|
273
273
|
x: cx1 / page.width,
|
|
274
274
|
y: cy1 / page.height,
|
|
275
275
|
w: (cx2 - cx1) / page.width,
|
|
@@ -384,7 +384,7 @@ function useAnnotationLayer({
|
|
|
384
384
|
makeId = defaultId
|
|
385
385
|
}) {
|
|
386
386
|
const [history, setHistory] = react.useState(
|
|
387
|
-
() => createHistory(
|
|
387
|
+
() => createHistory(chunkNSSGDZSL_cjs.emptyLayer(documentId, now()))
|
|
388
388
|
);
|
|
389
389
|
const [savedLayer, setSavedLayer] = react.useState(null);
|
|
390
390
|
const [status, setStatus] = react.useState("loading");
|
|
@@ -435,7 +435,7 @@ function useAnnotationLayer({
|
|
|
435
435
|
setSavedLayer(null);
|
|
436
436
|
setStoreReadOnly(false);
|
|
437
437
|
savedRef.current = null;
|
|
438
|
-
commit(createHistory(
|
|
438
|
+
commit(createHistory(chunkNSSGDZSL_cjs.emptyLayer(documentId, nowRef.current())));
|
|
439
439
|
storeRef.current.load(documentId).then((layer) => {
|
|
440
440
|
if (cancelled) return;
|
|
441
441
|
savedRef.current = layer;
|
|
@@ -879,7 +879,7 @@ function dragRect(origin, mode, dx, dy) {
|
|
|
879
879
|
const x2 = Math.min(Math.max(Math.max(left2, right), 0), 1);
|
|
880
880
|
const y1 = Math.min(Math.max(Math.min(top2, bottom), 0), 1);
|
|
881
881
|
const y2 = Math.min(Math.max(Math.max(top2, bottom), 0), 1);
|
|
882
|
-
return
|
|
882
|
+
return chunkNSSGDZSL_cjs.clampRect({
|
|
883
883
|
x: x1,
|
|
884
884
|
y: y1,
|
|
885
885
|
w: Math.max(x2 - x1, MIN_MARK),
|
|
@@ -996,7 +996,7 @@ function AnnotationPageOverlay({
|
|
|
996
996
|
const id = controller.add({
|
|
997
997
|
kind: "stamp",
|
|
998
998
|
page: pageNumber,
|
|
999
|
-
rect:
|
|
999
|
+
rect: chunkNSSGDZSL_cjs.clampRect({ x: a.x / page.width - w / 2, y: a.y / page.height - h / 2, w, h }),
|
|
1000
1000
|
label,
|
|
1001
1001
|
color: "#0d1a59",
|
|
1002
1002
|
image
|
|
@@ -1005,7 +1005,7 @@ function AnnotationPageOverlay({
|
|
|
1005
1005
|
controller.setTool("select");
|
|
1006
1006
|
if (id) controller.select(id);
|
|
1007
1007
|
} else if (tool === "stamp") {
|
|
1008
|
-
const placed = isTooSmall(rect) ?
|
|
1008
|
+
const placed = isTooSmall(rect) ? chunkNSSGDZSL_cjs.clampRect({
|
|
1009
1009
|
x: a.x / page.width - DEFAULT_STAMP.w / 2,
|
|
1010
1010
|
y: a.y / page.height - DEFAULT_STAMP.h / 2,
|
|
1011
1011
|
...DEFAULT_STAMP
|
|
@@ -1018,7 +1018,7 @@ function AnnotationPageOverlay({
|
|
|
1018
1018
|
color: settings.colors.stamp
|
|
1019
1019
|
});
|
|
1020
1020
|
} else if (tool === "comment") {
|
|
1021
|
-
const anchor =
|
|
1021
|
+
const anchor = chunkNSSGDZSL_cjs.clampRect({
|
|
1022
1022
|
x: a.x / page.width,
|
|
1023
1023
|
y: a.y / page.height,
|
|
1024
1024
|
w: COMMENT_ICON_PX / page.width,
|
|
@@ -1976,7 +1976,7 @@ function FreezeDialog({
|
|
|
1976
1976
|
const [burnPending, setBurnPending] = react.useState(false);
|
|
1977
1977
|
const [redactionLog, setRedactionLog] = react.useState(true);
|
|
1978
1978
|
const marks = controller.layer.annotations;
|
|
1979
|
-
const redactions = marks.filter(
|
|
1979
|
+
const redactions = marks.filter(chunkNSSGDZSL_cjs.isEffectiveRedaction);
|
|
1980
1980
|
const pending = pendingRedactions(controller.layer);
|
|
1981
1981
|
const hasRedactionMarks = marks.some((a) => a.kind === "redaction");
|
|
1982
1982
|
const forced = redactions.length > 0;
|
|
@@ -1985,7 +1985,7 @@ function FreezeDialog({
|
|
|
1985
1985
|
const counts = Object.keys(KIND_LABELS).map(
|
|
1986
1986
|
(k) => [
|
|
1987
1987
|
k,
|
|
1988
|
-
marks.filter((a) => a.kind === k && (k !== "redaction" ||
|
|
1988
|
+
marks.filter((a) => a.kind === k && (k !== "redaction" || chunkNSSGDZSL_cjs.isEffectiveRedaction(a))).length
|
|
1989
1989
|
]
|
|
1990
1990
|
).filter(([, n]) => n > 0);
|
|
1991
1991
|
return /* @__PURE__ */ jsxRuntime.jsx(chunkWYZJLZ67_cjs.Dialog, { open, onOpenChange: (next) => !busy && onOpenChange(next), children: /* @__PURE__ */ jsxRuntime.jsxs(chunkWYZJLZ67_cjs.DialogContent, { "data-testid": "freeze-dialog", children: [
|
|
@@ -2511,5 +2511,5 @@ exports.undo = undo;
|
|
|
2511
2511
|
exports.useAnnotationLayer = useAnnotationLayer;
|
|
2512
2512
|
exports.useAnnotationShortcuts = useAnnotationShortcuts;
|
|
2513
2513
|
exports.useTextSelectionMarks = useTextSelectionMarks;
|
|
2514
|
-
//# sourceMappingURL=chunk-
|
|
2515
|
-
//# sourceMappingURL=chunk-
|
|
2514
|
+
//# sourceMappingURL=chunk-ALLWAYMB.cjs.map
|
|
2515
|
+
//# sourceMappingURL=chunk-ALLWAYMB.cjs.map
|