@layers-app/shared 0.3.1 → 0.3.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 (29) hide show
  1. package/dist/assets/default-workspace-avatar.jpg.js +1 -1
  2. package/dist/components/ColorPicker/ColorPicker.d.ts +9 -1
  3. package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  4. package/dist/components/ColorPicker/ColorPicker.js +88 -74
  5. package/dist/components/ColorPicker/ColorPicker.module.css.js +31 -0
  6. package/dist/components/ColorPicker/ColorPickerList.d.ts +6 -0
  7. package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -0
  8. package/dist/components/ColorPicker/ColorPickerList.js +134 -0
  9. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts +13 -0
  10. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -0
  11. package/dist/components/ColorPicker/ColorPickerToolbar.js +132 -0
  12. package/dist/components/ColorPicker/icons.d.ts +11 -0
  13. package/dist/components/ColorPicker/icons.d.ts.map +1 -0
  14. package/dist/components/ColorPicker/icons.js +71 -0
  15. package/dist/components/ColorPicker/types.d.ts +49 -0
  16. package/dist/components/ColorPicker/types.d.ts.map +1 -0
  17. package/dist/components/ColorPicker/types.js +10 -0
  18. package/dist/components/ColorPicker/useRecentColors.d.ts +13 -0
  19. package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -0
  20. package/dist/components/ColorPicker/useRecentColors.js +39 -0
  21. package/dist/components/NavMenu/components/DnDProvider.d.ts.map +1 -1
  22. package/dist/components/NavMenu/components/DnDProvider.js +34 -31
  23. package/dist/config/envConfig.d.ts +4 -0
  24. package/dist/config/envConfig.d.ts.map +1 -1
  25. package/dist/index.css +1 -1
  26. package/dist/index.d.ts +5 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +474 -462
  29. package/package.json +1 -1
@@ -0,0 +1,132 @@
1
+ import { jsxs as C, jsx as o } from "react/jsx-runtime";
2
+ import { forwardRef as D, useState as M, useCallback as w, useMemo as T } from "react";
3
+ import { useMantineColorScheme as z, Box as u, Flex as x, UnstyledButton as H } from "@mantine/core";
4
+ import { TextColorIcon as F, HighlightSwatch as N } from "./icons.js";
5
+ import { isDefaultColor as I, normalizeColorItem as L } from "./types.js";
6
+ import { useRecentColors as j } from "./useRecentColors.js";
7
+ import t from "./ColorPicker.module.css.js";
8
+ function k({
9
+ isActive: i,
10
+ round: m,
11
+ disabled: a,
12
+ onClick: h,
13
+ children: c
14
+ }) {
15
+ return /* @__PURE__ */ o(
16
+ H,
17
+ {
18
+ type: "button",
19
+ className: `${t.inlineSwatch}${m ? ` ${t.inlineSwatchRound}` : ""}${i ? ` ${t.inlineSwatchActive}` : ""}`,
20
+ onMouseDown: (p) => p.preventDefault(),
21
+ onClick: h,
22
+ disabled: a,
23
+ children: c
24
+ }
25
+ );
26
+ }
27
+ const Q = D(({ sections: i, onChange: m, withRecentColors: a, maxRecentColors: h = 9, disabled: c, recentColorsLabel: p = "Recently used" }, R) => {
28
+ const { colorScheme: y } = z(), S = y === "dark", { recentColors: B, addRecent: g } = j({ maxItems: h }), [v, K] = M(B), d = w(
29
+ (e, r, n) => {
30
+ a && (g(e, r, n), K((l) => {
31
+ const f = l.filter(
32
+ (s) => !(s.value === e && s.sectionKey === r)
33
+ );
34
+ return [{ value: e, sectionKey: r, border: n }, ...f].slice(0, h);
35
+ })), m(e, r);
36
+ },
37
+ [m, a, g]
38
+ ), A = T(() => {
39
+ const e = {};
40
+ for (const r of i) e[r.key] = r;
41
+ return e;
42
+ }, [i]), b = w(
43
+ (e) => I(e) ? S ? "#FFFFFF" : "#000000" : e,
44
+ [S]
45
+ );
46
+ return /* @__PURE__ */ C(u, { ref: R, children: [
47
+ a && v.length > 0 && /* @__PURE__ */ C(u, { className: t.inlineSection, children: [
48
+ /* @__PURE__ */ o(u, { className: t.inlineSectionLabel, children: p }),
49
+ /* @__PURE__ */ o(x, { className: t.inlineRow, gap: 2, children: v.map((e, r) => {
50
+ const n = e.sectionKey ? A[e.sectionKey] : void 0;
51
+ return n?.key === "textColor" || n?.key === "color" || e.sectionKey === "color" ? /* @__PURE__ */ o(
52
+ k,
53
+ {
54
+ isActive: !1,
55
+ disabled: c,
56
+ onClick: () => d(e.value, e.sectionKey ?? ""),
57
+ children: /* @__PURE__ */ o(
58
+ F,
59
+ {
60
+ size: 20,
61
+ color: b(e.value),
62
+ showBorder: !0
63
+ }
64
+ )
65
+ },
66
+ `${e.sectionKey}-${e.value}-${r}`
67
+ ) : /* @__PURE__ */ o(
68
+ k,
69
+ {
70
+ isActive: !1,
71
+ round: !0,
72
+ disabled: c,
73
+ onClick: () => d(e.value, e.sectionKey ?? ""),
74
+ children: /* @__PURE__ */ o(
75
+ N,
76
+ {
77
+ bgColor: e.value,
78
+ borderColor: e.border || "var(--mantine-color-default-border)"
79
+ }
80
+ )
81
+ },
82
+ `${e.sectionKey}-${e.value}-${r}`
83
+ );
84
+ }) })
85
+ ] }),
86
+ i.map((e) => {
87
+ const r = e.key === "highlight" || e.key === "background" || e.key === "textHighlight";
88
+ return /* @__PURE__ */ C(u, { className: t.inlineSection, children: [
89
+ e.label && /* @__PURE__ */ o(u, { className: t.inlineSectionLabel, children: e.label }),
90
+ /* @__PURE__ */ o(x, { className: t.inlineRow, gap: 2, children: e.colors.map((n) => {
91
+ const { value: l, border: f } = L(n), s = l === e.value, $ = b(l);
92
+ return r ? /* @__PURE__ */ o(
93
+ k,
94
+ {
95
+ isActive: s,
96
+ round: !0,
97
+ disabled: c,
98
+ onClick: () => d(l, e.key, f),
99
+ children: /* @__PURE__ */ o(
100
+ N,
101
+ {
102
+ bgColor: l,
103
+ borderColor: f || $
104
+ }
105
+ )
106
+ },
107
+ l
108
+ ) : /* @__PURE__ */ o(
109
+ k,
110
+ {
111
+ isActive: s,
112
+ disabled: c,
113
+ onClick: () => d(l, e.key),
114
+ children: /* @__PURE__ */ o(
115
+ F,
116
+ {
117
+ size: 20,
118
+ color: $,
119
+ showBorder: !0
120
+ }
121
+ )
122
+ },
123
+ l
124
+ );
125
+ }) })
126
+ ] }, e.key);
127
+ })
128
+ ] });
129
+ });
130
+ export {
131
+ Q as ColorPickerToolbar
132
+ };
@@ -0,0 +1,11 @@
1
+ export declare function TextColorIcon({ size, color, showBorder, }: {
2
+ size?: number;
3
+ color?: string;
4
+ showBorder?: boolean;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export declare function HighlightSwatch({ size, bgColor, borderColor, }: {
7
+ size?: number;
8
+ bgColor: string;
9
+ borderColor: string;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/icons.tsx"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,EAC5B,IAAS,EACT,KAAoC,EACpC,UAAU,GACX,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,2CAgCA;AAED,wBAAgB,eAAe,CAAC,EAC9B,IAAS,EACT,OAAO,EACP,WAAW,GACZ,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,2CA4BA"}
@@ -0,0 +1,71 @@
1
+ import { jsx as n, jsxs as c } from "react/jsx-runtime";
2
+ function s({
3
+ size: t = 20,
4
+ color: r = "var(--mantine-color-white)",
5
+ showBorder: e
6
+ }) {
7
+ return /* @__PURE__ */ c(
8
+ "svg",
9
+ {
10
+ xmlns: "http://www.w3.org/2000/svg",
11
+ width: t,
12
+ height: t,
13
+ viewBox: "0 0 20 20",
14
+ fill: "none",
15
+ children: [
16
+ e && /* @__PURE__ */ n(
17
+ "rect",
18
+ {
19
+ x: "0.5",
20
+ y: "0.5",
21
+ width: "19",
22
+ height: "19",
23
+ rx: "5.5",
24
+ stroke: "var(--mantine-color-default-border)",
25
+ strokeWidth: "1",
26
+ fill: "none"
27
+ }
28
+ ),
29
+ /* @__PURE__ */ n("g", { transform: "translate(4.3, 2.85) scale(0.95)", children: /* @__PURE__ */ n(
30
+ "path",
31
+ {
32
+ d: "M5.74945 0C6.57421 0 7.09678 0.678265 7.50336 1.43555C7.93323 2.23628 8.38332 3.42022 8.95843 4.92676L11.4623 11.4873C11.5716 11.7742 11.4279 12.0955 11.1411 12.2051C10.8541 12.3144 10.5329 12.1706 10.4233 11.8838L8.5766 7.04883H2.9223L1.07562 11.8838C0.965974 12.1707 0.644849 12.3146 0.357848 12.2051C0.0710441 12.0955 -0.0726477 11.7742 0.0365593 11.4873L2.54047 4.92676C3.11563 3.42012 3.56662 2.23629 3.99652 1.43555C4.40306 0.678393 4.92485 8.51363e-05 5.74945 0ZM5.74945 1.11328C5.62925 1.11335 5.38778 1.19685 4.97699 1.96191C4.5893 2.68404 4.16803 3.7852 3.5805 5.32422L3.34711 5.93555H8.15179L7.9184 5.32422C7.33089 3.78522 6.9096 2.68403 6.52191 1.96191C6.11099 1.19664 5.86959 1.11328 5.74945 1.11328Z",
33
+ fill: r === "inherit" || r === "currentColor" ? "var(--mantine-color-white)" : r
34
+ }
35
+ ) })
36
+ ]
37
+ }
38
+ );
39
+ }
40
+ function d({
41
+ size: t = 24,
42
+ bgColor: r,
43
+ borderColor: e
44
+ }) {
45
+ const o = r === "inherit" || r === "" || r === "default", i = t * 0.375, l = o ? "var(--mantine-color-body)" : r, h = o ? "var(--mantine-color-default-border)" : e;
46
+ return /* @__PURE__ */ n(
47
+ "svg",
48
+ {
49
+ xmlns: "http://www.w3.org/2000/svg",
50
+ width: t,
51
+ height: t,
52
+ viewBox: `0 0 ${t} ${t}`,
53
+ fill: "none",
54
+ children: /* @__PURE__ */ n(
55
+ "circle",
56
+ {
57
+ cx: t / 2,
58
+ cy: t / 2,
59
+ r: i,
60
+ fill: l,
61
+ stroke: h,
62
+ strokeWidth: "1.5"
63
+ }
64
+ )
65
+ }
66
+ );
67
+ }
68
+ export {
69
+ d as HighlightSwatch,
70
+ s as TextColorIcon
71
+ };
@@ -0,0 +1,49 @@
1
+ import type { FlexProps } from '@mantine/core';
2
+ export type ColorItem = string | {
3
+ value: string;
4
+ label?: string;
5
+ border?: string;
6
+ bg?: string;
7
+ };
8
+ export interface ColorSection {
9
+ key: string;
10
+ label: string;
11
+ colors: ColorItem[];
12
+ value?: string;
13
+ type?: 'text' | 'highlight';
14
+ }
15
+ export interface RecentColorEntry {
16
+ value: string;
17
+ sectionKey?: string;
18
+ border?: string;
19
+ }
20
+ export type ColorPickerOnChange = (value: string, sectionKey?: string) => void;
21
+ export interface ColorPickerBaseProps {
22
+ colors?: ColorItem[];
23
+ sections?: ColorSection[];
24
+ value?: string;
25
+ onChange?: ColorPickerOnChange;
26
+ withRecentColors?: boolean;
27
+ maxRecentColors?: number;
28
+ swatchSize?: number;
29
+ withTick?: boolean;
30
+ }
31
+ export interface ColorPickerInlineProps extends ColorPickerBaseProps, Omit<FlexProps, 'onChange'> {
32
+ swatchShape?: 'circle' | 'square';
33
+ fullWidth?: boolean;
34
+ allowCustomColor?: boolean;
35
+ }
36
+ export interface ColorPickerListProps extends ColorPickerBaseProps {
37
+ columns?: number;
38
+ }
39
+ export interface ColorPickerCompactProps extends Omit<ColorPickerBaseProps, 'sections' | 'withRecentColors'>, Omit<FlexProps, 'onChange'> {
40
+ swatchShape?: 'circle' | 'square';
41
+ }
42
+ export declare function normalizeColorItem(item: ColorItem): {
43
+ value: string;
44
+ label: string;
45
+ border?: string;
46
+ bg?: string;
47
+ };
48
+ export declare function isDefaultColor(value: string): boolean;
49
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,M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W,oBAAqB,SAAQ,oBAAoB;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBACf,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,kBAAkB,CAAC,EACjE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC7B,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACnC;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,GAAG;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAKA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAErD"}
@@ -0,0 +1,10 @@
1
+ function n(r) {
2
+ return typeof r == "string" ? { value: r, label: r } : { label: r.value, ...r };
3
+ }
4
+ function l(r) {
5
+ return r === "inherit" || r === "" || r === "default";
6
+ }
7
+ export {
8
+ l as isDefaultColor,
9
+ n as normalizeColorItem
10
+ };
@@ -0,0 +1,13 @@
1
+ import type { RecentColorEntry } from './types';
2
+ interface UseRecentColorsOptions {
3
+ storageKey?: string;
4
+ maxItems?: number;
5
+ }
6
+ export declare function useRecentColors(options?: UseRecentColorsOptions): {
7
+ recentColors: RecentColorEntry[];
8
+ addRecent: (value: string, sectionKey?: string, border?: string) => void;
9
+ clearRecent: () => void;
10
+ reload: () => void;
11
+ };
12
+ export {};
13
+ //# sourceMappingURL=useRecentColors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRecentColors.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/useRecentColors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAKhD,UAAU,sBAAsB;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAmBD,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,sBAAsB;;uBAYpD,MAAM,eAAe,MAAM,WAAW,MAAM;;;EAsBvD"}
@@ -0,0 +1,39 @@
1
+ import { useState as I, useCallback as c } from "react";
2
+ const d = "color-picker-recent", p = 11;
3
+ function n(e) {
4
+ try {
5
+ const t = localStorage.getItem(e);
6
+ return t ? JSON.parse(t) : [];
7
+ } catch {
8
+ return [];
9
+ }
10
+ }
11
+ function E(e, t, o) {
12
+ try {
13
+ localStorage.setItem(e, JSON.stringify(t.slice(0, o)));
14
+ } catch {
15
+ }
16
+ }
17
+ function v(e) {
18
+ const t = e?.storageKey ?? d, o = e?.maxItems ?? p, [i, r] = I(() => n(t)), S = c(() => {
19
+ r(n(t));
20
+ }, [t]), g = c(
21
+ (s, a, f) => {
22
+ const y = n(t).filter(
23
+ (m) => !(m.value === s && m.sectionKey === a)
24
+ ), l = [{ value: s, sectionKey: a, border: f }, ...y].slice(0, o);
25
+ E(t, l, o), r(l);
26
+ },
27
+ [t, o]
28
+ ), u = c(() => {
29
+ try {
30
+ localStorage.removeItem(t);
31
+ } catch {
32
+ }
33
+ r([]);
34
+ }, [t]);
35
+ return { recentColors: i, addRecent: g, clearRecent: u, reload: S };
36
+ }
37
+ export {
38
+ v as useRecentColors
39
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"DnDProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/NavMenu/components/DnDProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAa/D,OAAO,EAEL,kBAAkB,EAEnB,MAAM,UAAU,CAAC;AAGlB,KAAK,gBAAgB,GAAG;IACtB,aAAa,EAAE,kBAAkB,CAAC;IAClC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;CAC/C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,4CAIzB,iBAAiB,CAAC,gBAAgB,CAAC,4CAqFrC,CAAC"}
1
+ {"version":3,"file":"DnDProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/NavMenu/components/DnDProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAa/D,OAAO,EAEL,kBAAkB,EAEnB,MAAM,UAAU,CAAC;AAGlB,KAAK,gBAAgB,GAAG;IACtB,aAAa,EAAE,kBAAkB,CAAC;IAClC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;CAC/C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,4CAIzB,iBAAiB,CAAC,gBAAgB,CAAC,4CA0FrC,CAAC"}
@@ -1,66 +1,69 @@
1
- import { jsxs as g, jsx as S } from "react/jsx-runtime";
2
- import { useCallback as c, useRef as T } from "react";
3
- import { useSensor as u, MouseSensor as v, TouchSensor as A, useSensors as x, DndContext as M, pointerWithin as B } from "@dnd-kit/core";
4
- import { DraggableOverlay as C } from "./DraggableOverlay.js";
5
- const W = ({
1
+ import { jsxs as S, jsx as T } from "react/jsx-runtime";
2
+ import { useCallback as s, useRef as v } from "react";
3
+ import { useSensor as u, MouseSensor as A, TouchSensor as x, useSensors as M, DndContext as B, pointerWithin as C } from "@dnd-kit/core";
4
+ import { DraggableOverlay as j } from "./DraggableOverlay.js";
5
+ const Y = ({
6
6
  containerRef: e,
7
7
  children: d,
8
- onOrderChange: s
8
+ onOrderChange: a
9
9
  }) => {
10
- const m = u(v, {
10
+ const l = u(A, {
11
11
  activationConstraint: {
12
12
  distance: 15
13
13
  }
14
- }), l = u(A, {
14
+ }), m = u(x, {
15
15
  activationConstraint: {
16
16
  distance: 15
17
17
  }
18
- }), p = x(m, l), b = c(
19
- ({ active: t, over: n }) => {
20
- if (!n || !t) return;
21
- const r = n.data.current;
22
- r.itemAllowDragDrop !== !1 && s({
18
+ }), p = M(l, m), D = s(
19
+ ({ active: t, over: o }) => {
20
+ if (!o || !t) return;
21
+ const r = o.data.current;
22
+ r.itemAllowDragDrop !== !1 && a({
23
23
  over: r,
24
24
  item: t.data.current,
25
- position: o.current ?? "inside"
25
+ position: n.current ?? "inside"
26
26
  });
27
27
  },
28
- [s]
29
- ), o = T(null), D = c(
30
- ({ over: t, active: n }) => {
28
+ [a]
29
+ ), n = v(null), b = s(() => {
30
+ n.current = null;
31
+ }, []), f = s(
32
+ ({ over: t, active: o }) => {
31
33
  if (!t) {
32
34
  e.current?.removeAttribute("data-nearest-side");
33
35
  return;
34
36
  }
35
- const r = n.rect.current.translated;
37
+ const r = o.rect.current.translated;
36
38
  if (!r) return;
37
- const a = r.top + r.height / 2, i = 8, f = Math.abs(a - t.rect.top), h = Math.abs(a - t.rect.bottom);
38
- if (f <= i) {
39
- o.current = "before", e.current?.setAttribute("data-nearest-side", "top");
39
+ const i = r.top + r.height / 2, c = 8, h = Math.abs(i - t.rect.top), g = Math.abs(i - t.rect.bottom);
40
+ if (h <= c) {
41
+ n.current = "before", e.current?.setAttribute("data-nearest-side", "top");
40
42
  return;
41
43
  }
42
- if (h <= i) {
43
- o.current = "after", e.current?.setAttribute("data-nearest-side", "bottom");
44
+ if (g <= c) {
45
+ n.current = "after", e.current?.setAttribute("data-nearest-side", "bottom");
44
46
  return;
45
47
  }
46
- o.current = "inside", e.current?.setAttribute("data-nearest-side", "inside");
48
+ n.current = "inside", e.current?.setAttribute("data-nearest-side", "inside");
47
49
  },
48
50
  [e]
49
51
  );
50
- return /* @__PURE__ */ g(
51
- M,
52
+ return /* @__PURE__ */ S(
53
+ B,
52
54
  {
53
55
  sensors: p,
54
- onDragEnd: b,
55
- collisionDetection: B,
56
- onDragMove: D,
56
+ onDragEnd: D,
57
+ onDragStart: b,
58
+ collisionDetection: C,
59
+ onDragMove: f,
57
60
  children: [
58
61
  d,
59
- /* @__PURE__ */ S(C, {})
62
+ /* @__PURE__ */ T(j, {})
60
63
  ]
61
64
  }
62
65
  );
63
66
  };
64
67
  export {
65
- W as DnDProvider
68
+ Y as DnDProvider
66
69
  };
@@ -57,6 +57,10 @@ export interface EnvConfig {
57
57
  enabled?: boolean;
58
58
  };
59
59
  };
60
+ collab?: {
61
+ enabled?: boolean;
62
+ wssUrl?: string;
63
+ };
60
64
  ai?: {
61
65
  enabled?: boolean;
62
66
  };
@@ -1 +1 @@
1
- {"version":3,"file":"envConfig.d.ts","sourceRoot":"","sources":["../../src/config/envConfig.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE;QACT,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,QAAQ,CAAC,EAAE,MAAM,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