@layers-app/shared 0.2.1 → 0.2.3

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.
Files changed (38) hide show
  1. package/dist/assets/svg/group_default_icon.svg.js +4 -0
  2. package/dist/components/AppContainer/hooks/useAppContainerStore.d.ts.map +1 -1
  3. package/dist/components/AppContainer/hooks/useAppContainerStore.js +26 -19
  4. package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
  5. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
  6. package/dist/components/CommentComposer/CommentEditorHotkeys.js +25 -22
  7. package/dist/components/CommentComposer/index.d.ts.map +1 -1
  8. package/dist/components/CommentComposer/index.js +237 -153
  9. package/dist/components/CommentComposer/{useFloatingPosition.d.ts → useVirtualAnchor.d.ts} +3 -4
  10. package/dist/components/CommentComposer/useVirtualAnchor.d.ts.map +1 -0
  11. package/dist/components/CommentComposer/useVirtualAnchor.js +71 -0
  12. package/dist/components/FilePicker/FilePicker.js +1 -1
  13. package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +5 -5
  14. package/dist/components/GroupAvatar/index.d.ts +9 -0
  15. package/dist/components/GroupAvatar/index.d.ts.map +1 -0
  16. package/dist/components/GroupAvatar/index.js +24 -0
  17. package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
  18. package/dist/components/modals/RemoveConfirmModal.js +22 -21
  19. package/dist/components/table/FrontTable.d.ts +2 -1
  20. package/dist/components/table/FrontTable.d.ts.map +1 -1
  21. package/dist/components/table/components/TableCell.d.ts.map +1 -1
  22. package/dist/components/table/components/TableCell.js +63 -26
  23. package/dist/components/table/components/TableMenu.d.ts +2 -1
  24. package/dist/components/table/components/TableMenu.d.ts.map +1 -1
  25. package/dist/components/table/components/TableMenu.js +15 -14
  26. package/dist/constants.d.ts +4 -0
  27. package/dist/constants.d.ts.map +1 -1
  28. package/dist/constants.js +7 -4
  29. package/dist/index.css +1 -1
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +390 -384
  33. package/dist/store/accessOptionsControl.d.ts +11 -1
  34. package/dist/store/accessOptionsControl.d.ts.map +1 -1
  35. package/dist/store/accessOptionsControl.js +15 -7
  36. package/package.json +1 -1
  37. package/dist/components/CommentComposer/useFloatingPosition.d.ts.map +0 -1
  38. package/dist/components/CommentComposer/useFloatingPosition.js +0 -115
@@ -1,7 +1,17 @@
1
+ export declare enum EntityType {
2
+ None = "none",
3
+ Page = "page",
4
+ Form = "form",
5
+ Flow = "flow",
6
+ Project = "project",
7
+ Sprint = "sprint"
8
+ }
1
9
  interface AccessOptionsControl {
2
10
  opened: boolean;
11
+ entityId: string | null;
12
+ entityType: EntityType | null;
3
13
  }
4
14
  export declare const useAccessOptionsControl: import("zustand").UseBoundStore<import("zustand").StoreApi<AccessOptionsControl>>;
5
- export declare const toggleAccessOptionsControl: (value: boolean) => void;
15
+ export declare const toggleAccessOptionsControl: (value: boolean, entityId?: string, entityType?: EntityType) => void;
6
16
  export {};
7
17
  //# sourceMappingURL=accessOptionsControl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"accessOptionsControl.d.ts","sourceRoot":"","sources":["../../src/store/accessOptionsControl.ts"],"names":[],"mappings":"AAEA,UAAU,oBAAoB;IAC5B,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,uBAAuB,mFAEjC,CAAC;AAEJ,eAAO,MAAM,0BAA0B,GAAI,OAAO,OAAO,SAExD,CAAC"}
1
+ {"version":3,"file":"accessOptionsControl.d.ts","sourceRoot":"","sources":["../../src/store/accessOptionsControl.ts"],"names":[],"mappings":"AAEA,oBAAY,UAAU;IACpB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAED,UAAU,oBAAoB;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;CAC/B;AAED,eAAO,MAAM,uBAAuB,mFAIjC,CAAC;AAEJ,eAAO,MAAM,0BAA0B,GACrC,OAAO,OAAO,EACd,WAAW,MAAM,EACjB,aAAa,UAAU,SAOxB,CAAC"}
@@ -1,10 +1,18 @@
1
- import { create as o } from "zustand";
2
- const t = o(() => ({
3
- opened: !1
4
- })), n = (e) => {
5
- t.setState({ opened: e });
1
+ import { create as r } from "zustand";
2
+ var l = /* @__PURE__ */ ((o) => (o.None = "none", o.Page = "page", o.Form = "form", o.Flow = "flow", o.Project = "project", o.Sprint = "sprint", o))(l || {});
3
+ const s = r(() => ({
4
+ opened: !1,
5
+ entityId: null,
6
+ entityType: null
7
+ })), c = (o, e, n) => {
8
+ s.setState({
9
+ opened: o,
10
+ entityId: o && e ? e : null,
11
+ entityType: o && n ? n : null
12
+ });
6
13
  };
7
14
  export {
8
- n as toggleAccessOptionsControl,
9
- t as useAccessOptionsControl
15
+ l as EntityType,
16
+ c as toggleAccessOptionsControl,
17
+ s as useAccessOptionsControl
10
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layers-app/shared",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Shared components, hooks, and utilities for Layers application",
5
5
  "files": [
6
6
  "dist",
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFloatingPosition.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/useFloatingPosition.ts"],"names":[],"mappings":"AAEA,UAAU,wBAAwB;IAChC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,CACf,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,EACzC,cAAc,EAAE;QACd,SAAS,EAAE,cAAc,CAAC;QAC1B,QAAQ,EAAE,eAAe,EAAE,CAAC;KAC7B,KACE,IAAI,CAAC;IACV,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC1C,cAAc,EAAE;QACd,SAAS,EAAE,cAAc,CAAC;QAC1B,QAAQ,EAAE,eAAe,EAAE,CAAC;KAC7B,CAAC;CACH;AAED,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,OAAO,EACP,cAAc,EACd,YAAY,EACZ,cAAc,GACf,EAAE,wBAAwB,QAqR1B"}
@@ -1,115 +0,0 @@
1
- import { useRef as T, useCallback as C, useLayoutEffect as k, useEffect as g } from "react";
2
- function _({
3
- boxRef: n,
4
- isFloat: s,
5
- updateLocation: m,
6
- selectionRef: f,
7
- selectionState: u
8
- }) {
9
- const w = T(null), E = T(!1), d = T({ placement: "bottom", lockedUntil: 0 }), v = 10 * 30 * 0.7, a = C(() => {
10
- if (!n.current) return;
11
- const e = n.current, t = e.querySelector(
12
- '[class*="editorWrapper"]'
13
- ), l = t?.scrollHeight || 0, r = l > v, i = l > 50;
14
- s && i ? e.setAttribute("data-multiline", "true") : e.removeAttribute("data-multiline"), r && t ? (t.style.maxHeight = `${v}px`, t.style.overflowY = "auto", t.style.scrollbarWidth = "thin", e.setAttribute("data-editor-constrained", "true")) : t && (t.style.maxHeight = "", t.style.overflowY = "", t.style.scrollbarWidth = "", e.removeAttribute("data-editor-constrained"));
15
- }, [n, s, v]), y = C(() => {
16
- if (!n.current || !w.current || !s || !E.current)
17
- return;
18
- const e = n.current, t = w.current, l = e.offsetHeight, r = 36, i = 10, H = window.innerHeight - t.bottom, b = t.top, M = Date.now(), I = M < d.current.lockedUntil;
19
- let c, p, A;
20
- I ? c = d.current.placement : (H >= l + r ? c = "bottom" : b >= l ? c = "top" : c = "bottom", c !== d.current.placement && (d.current = {
21
- placement: c,
22
- lockedUntil: M + 500
23
- })), c === "bottom" && H < l + r ? p = H - r : c === "top" && b < l && (p = b - r);
24
- const x = window.pageYOffset || document.documentElement.scrollTop;
25
- if (c === "bottom" ? A = t.bottom + i + x : A = t.top - l - i + x, e.style.top = `${A}px`, a(), p) {
26
- e.style.maxHeight = `${p}px`, e.setAttribute("data-constrained", "true"), e.style.display = "flex", e.style.flexDirection = "column", e.style.overflow = "hidden";
27
- const o = e.querySelector(
28
- '[class*="composerContainer"]'
29
- );
30
- o && (o.style.display = "flex", o.style.flexDirection = "column", o.style.flex = "1 1 auto", o.style.minHeight = "0", o.style.overflow = "hidden");
31
- } else {
32
- e.style.maxHeight = "", e.removeAttribute("data-constrained"), e.style.display = "", e.style.flexDirection = "", e.style.overflow = "";
33
- const o = e.querySelector(
34
- '[class*="composerContainer"]'
35
- );
36
- o && (o.style.display = "", o.style.flexDirection = "", o.style.flex = "", o.style.minHeight = "", o.style.overflow = "");
37
- }
38
- e.setAttribute("data-placement", c);
39
- }, [s, n, a]), h = C(
40
- (e) => {
41
- if (e.elements.length > 0) {
42
- const t = e.elements[0], l = e.elements[e.elements.length - 1], r = t.getBoundingClientRect(), i = l.getBoundingClientRect();
43
- w.current = {
44
- top: r.top,
45
- bottom: i.bottom,
46
- left: Math.min(r.left, i.left),
47
- right: Math.max(r.right, i.right),
48
- width: Math.max(r.right, i.right) - Math.min(r.left, i.left),
49
- height: i.bottom - r.top,
50
- x: Math.min(r.left, i.left),
51
- y: r.top
52
- }, E.current = !0;
53
- }
54
- },
55
- []
56
- );
57
- k(() => {
58
- if (!s || !m) return;
59
- m(n.current, f, u), setTimeout(() => {
60
- h(u);
61
- }, 50);
62
- const e = u.container, t = document.body;
63
- if (t !== null)
64
- return t.appendChild(e), () => {
65
- t.removeChild(e);
66
- };
67
- }, [
68
- s,
69
- m,
70
- u,
71
- h,
72
- n,
73
- f
74
- ]), g(() => {
75
- a();
76
- }, [a]), g(() => {
77
- if (!n.current) return;
78
- const e = new ResizeObserver(() => {
79
- s ? y() : a();
80
- });
81
- return e.observe(n.current), () => {
82
- e.disconnect();
83
- };
84
- }, [s, y, a, n]), g(() => {
85
- if (!s || !m) return;
86
- let e;
87
- const t = () => {
88
- clearTimeout(e), e = setTimeout(() => {
89
- E.current = !1, m(n.current, f, u), setTimeout(() => {
90
- h(u), y(), d.current.lockedUntil = Date.now() + 500;
91
- }, 50);
92
- }, 150);
93
- };
94
- return window.addEventListener("resize", t), () => {
95
- clearTimeout(e), window.removeEventListener("resize", t);
96
- };
97
- }, [
98
- s,
99
- m,
100
- y,
101
- u,
102
- h,
103
- n,
104
- f
105
- ]), g(() => {
106
- const e = document.querySelector("main");
107
- if (e)
108
- return s ? e.style.overflow = "hidden" : e.style.overflow = "", () => {
109
- e.style.overflow = "";
110
- };
111
- }, [s]);
112
- }
113
- export {
114
- _ as useFloatingPosition
115
- };