@krak-stack/registry 0.10.4 → 0.10.6

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 (31) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/components/ui/animated-list.d.ts +6 -7
  3. package/dist/components/ui/animated-list.js +329 -139
  4. package/dist/components/ui/animated-number.js +47 -24
  5. package/dist/components/ui/auto-height.js +56 -15
  6. package/dist/components/ui/data-table.js +16 -13
  7. package/dist/components/ui/email-editor.d.ts +124 -0
  8. package/dist/components/ui/email-editor.js +2651 -0
  9. package/dist/components/ui/form.d.ts +5 -5
  10. package/dist/components/ui/presence-transition.d.ts +1 -1
  11. package/dist/components/ui/presence-transition.js +79 -26
  12. package/dist/components/ui/rich-text-editor.d.ts +70 -0
  13. package/dist/components/ui/rich-text-editor.js +1135 -0
  14. package/dist/components/ui/time-picker.d.ts +13 -4
  15. package/dist/components/ui/time-picker.js +141 -47
  16. package/dist/components/ui/time-picker.schema.d.ts +16 -2
  17. package/dist/lib/email-document/model.d.ts +26 -0
  18. package/dist/lib/email-document/model.js +253 -0
  19. package/dist/lib/email-document/render.d.ts +115 -0
  20. package/dist/lib/email-document/render.js +469 -0
  21. package/dist/lib/email-document/schema.d.ts +285 -0
  22. package/dist/lib/email-document/schema.js +139 -0
  23. package/dist/lib/krakmotion.d.ts +27 -0
  24. package/dist/lib/rich-text/dom.d.ts +40 -0
  25. package/dist/lib/rich-text/model.d.ts +19 -0
  26. package/dist/lib/rich-text/model.js +141 -0
  27. package/dist/lib/rich-text/schema.d.ts +64 -0
  28. package/dist/lib/rich-text/schema.js +53 -0
  29. package/dist/services/events/client/audit-log-table.js +16 -13
  30. package/dist/services/webhooks/client/delivery-table.js +16 -13
  31. package/package.json +29 -5
@@ -0,0 +1,64 @@
1
+ import { Schema } from "effect";
2
+ export declare const RichTextLink: Schema.String;
3
+ export declare const RichTextMarks: Schema.Struct<{
4
+ readonly bold: Schema.optional<Schema.Boolean>;
5
+ readonly italic: Schema.optional<Schema.Boolean>;
6
+ readonly underline: Schema.optional<Schema.Boolean>;
7
+ readonly href: Schema.optional<Schema.String>;
8
+ }>;
9
+ export declare const RichTextInline: Schema.Union<readonly [Schema.Struct<{
10
+ readonly type: Schema.Literal<"text">;
11
+ readonly text: Schema.String;
12
+ readonly marks: Schema.optional<Schema.Struct<{
13
+ readonly bold: Schema.optional<Schema.Boolean>;
14
+ readonly italic: Schema.optional<Schema.Boolean>;
15
+ readonly underline: Schema.optional<Schema.Boolean>;
16
+ readonly href: Schema.optional<Schema.String>;
17
+ }>>;
18
+ }>, Schema.Struct<{
19
+ readonly type: Schema.Literal<"variable">;
20
+ readonly key: Schema.String;
21
+ readonly marks: Schema.optional<Schema.Struct<{
22
+ readonly bold: Schema.optional<Schema.Boolean>;
23
+ readonly italic: Schema.optional<Schema.Boolean>;
24
+ readonly underline: Schema.optional<Schema.Boolean>;
25
+ readonly href: Schema.optional<Schema.String>;
26
+ }>>;
27
+ }>]>;
28
+ export declare const RichTextBlockKind: Schema.Literals<readonly ["paragraph", "heading", "bullet", "numbered"]>;
29
+ export declare const RichTextDocument: Schema.Struct<{
30
+ readonly version: Schema.Literal<1>;
31
+ readonly blocks: Schema.$Array<Schema.Struct<{
32
+ readonly type: Schema.Literals<readonly ["paragraph", "heading", "bullet", "numbered"]>;
33
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
34
+ readonly type: Schema.Literal<"text">;
35
+ readonly text: Schema.String;
36
+ readonly marks: Schema.optional<Schema.Struct<{
37
+ readonly bold: Schema.optional<Schema.Boolean>;
38
+ readonly italic: Schema.optional<Schema.Boolean>;
39
+ readonly underline: Schema.optional<Schema.Boolean>;
40
+ readonly href: Schema.optional<Schema.String>;
41
+ }>>;
42
+ }>, Schema.Struct<{
43
+ readonly type: Schema.Literal<"variable">;
44
+ readonly key: Schema.String;
45
+ readonly marks: Schema.optional<Schema.Struct<{
46
+ readonly bold: Schema.optional<Schema.Boolean>;
47
+ readonly italic: Schema.optional<Schema.Boolean>;
48
+ readonly underline: Schema.optional<Schema.Boolean>;
49
+ readonly href: Schema.optional<Schema.String>;
50
+ }>>;
51
+ }>]>>;
52
+ }>>;
53
+ }>;
54
+ export declare const RichTextVariable: Schema.Struct<{
55
+ readonly key: Schema.String;
56
+ readonly label: Schema.String;
57
+ readonly type: Schema.Literals<readonly ["text", "url"]>;
58
+ readonly sample: Schema.String;
59
+ }>;
60
+ export type RichTextDocument = typeof RichTextDocument.Type;
61
+ export type RichTextInline = typeof RichTextInline.Type;
62
+ export type RichTextMarks = typeof RichTextMarks.Type;
63
+ export type RichTextBlockKind = typeof RichTextBlockKind.Type;
64
+ export type RichTextVariable = typeof RichTextVariable.Type;
@@ -0,0 +1,53 @@
1
+ // ../../src/lib/rich-text/schema.ts
2
+ import { Schema } from "effect";
3
+ var RichTextLink = Schema.String.check(Schema.isMaxLength(2000), Schema.makeFilter((value) => {
4
+ if (/[\s\p{Cc}\\{}]/u.test(value))
5
+ return false;
6
+ const url = URL.parse(value);
7
+ return url !== null && ["https:", "mailto:"].includes(url.protocol) && !url.username && !url.password;
8
+ })).annotate({ identifier: "RichTextLink" });
9
+ var RichTextMarks = Schema.Struct({
10
+ bold: Schema.optional(Schema.Boolean),
11
+ italic: Schema.optional(Schema.Boolean),
12
+ underline: Schema.optional(Schema.Boolean),
13
+ href: Schema.optional(RichTextLink)
14
+ }).annotate({ identifier: "RichTextMarks" });
15
+ var RichTextInline = Schema.Union([
16
+ Schema.Struct({
17
+ type: Schema.Literal("text"),
18
+ text: Schema.String.check(Schema.isMaxLength(20000)),
19
+ marks: Schema.optional(RichTextMarks)
20
+ }),
21
+ Schema.Struct({
22
+ type: Schema.Literal("variable"),
23
+ key: Schema.String.check(Schema.isPattern(/^[a-zA-Z][a-zA-Z0-9_.]{0,79}$/)),
24
+ marks: Schema.optional(RichTextMarks)
25
+ })
26
+ ]).annotate({ identifier: "RichTextInline" });
27
+ var RichTextBlockKind = Schema.Literals([
28
+ "paragraph",
29
+ "heading",
30
+ "bullet",
31
+ "numbered"
32
+ ]).annotate({ identifier: "RichTextBlockKind" });
33
+ var RichTextDocument = Schema.Struct({
34
+ version: Schema.Literal(1),
35
+ blocks: Schema.Array(Schema.Struct({
36
+ type: RichTextBlockKind,
37
+ content: Schema.Array(RichTextInline).check(Schema.isMaxLength(2000))
38
+ })).check(Schema.isMinLength(1), Schema.isMaxLength(100))
39
+ }).check(Schema.makeFilter((value) => value.blocks.reduce((size, block) => size + block.content.reduce((count, inline) => count + (inline.type === "text" ? inline.text.length : 1), 0), 0) <= 20000)).annotate({ identifier: "RichTextDocument" });
40
+ var RichTextVariable = Schema.Struct({
41
+ key: Schema.String.check(Schema.isPattern(/^[a-zA-Z][a-zA-Z0-9_.]{0,79}$/)),
42
+ label: Schema.String,
43
+ type: Schema.Literals(["text", "url"]),
44
+ sample: Schema.String
45
+ }).annotate({ identifier: "RichTextVariable" });
46
+ export {
47
+ RichTextBlockKind,
48
+ RichTextDocument,
49
+ RichTextInline,
50
+ RichTextLink,
51
+ RichTextMarks,
52
+ RichTextVariable
53
+ };
@@ -3605,8 +3605,8 @@ var GalleryCard = ({
3605
3605
  /* @__PURE__ */ jsxs9(CardHeader, {
3606
3606
  className: cn("relative", hasRowActionMenu(store) && "pr-12"),
3607
3607
  children: [
3608
- selection || draggable || tagIds.length ? /* @__PURE__ */ jsxs9("div", {
3609
- className: "flex flex-wrap items-center gap-2",
3608
+ selection || draggable ? /* @__PURE__ */ jsxs9("div", {
3609
+ className: "flex items-center gap-2",
3610
3610
  children: [
3611
3611
  selection ? /* @__PURE__ */ jsx15(Checkbox, {
3612
3612
  "aria-label": store.config.labels.selectRow,
@@ -3617,22 +3617,25 @@ var GalleryCard = ({
3617
3617
  }) : null,
3618
3618
  draggable ? /* @__PURE__ */ jsx15(DragHandle, {
3619
3619
  tableAtom
3620
- }) : null,
3621
- tagIds.map((id) => {
3622
- const column = find(id);
3623
- return column ? /* @__PURE__ */ jsx15(GalleryTag, {
3624
- row,
3625
- column,
3626
- locale: store.config.locale,
3627
- labels: store.config.labels,
3628
- icon: id === gallery.tag ? gallery.tagIcon : undefined
3629
- }, id) : null;
3630
- })
3620
+ }) : null
3631
3621
  ]
3632
3622
  }) : null,
3633
3623
  /* @__PURE__ */ jsx15(CardTitle, {
3634
3624
  children: name ? renderCell(row, name, store.config.locale, store.config.labels) : row.id
3635
3625
  }),
3626
+ tagIds.length ? /* @__PURE__ */ jsx15("div", {
3627
+ className: "flex flex-wrap items-center gap-2",
3628
+ children: tagIds.map((id) => {
3629
+ const column = find(id);
3630
+ return column ? /* @__PURE__ */ jsx15(GalleryTag, {
3631
+ row,
3632
+ column,
3633
+ locale: store.config.locale,
3634
+ labels: store.config.labels,
3635
+ icon: id === gallery.tag ? gallery.tagIcon : undefined
3636
+ }, id) : null;
3637
+ })
3638
+ }) : null,
3636
3639
  description ? /* @__PURE__ */ jsx15("div", {
3637
3640
  className: "text-muted-foreground line-clamp-3 text-sm",
3638
3641
  children: renderCell(row, description, store.config.locale, store.config.labels)
@@ -3609,8 +3609,8 @@ var GalleryCard = ({
3609
3609
  /* @__PURE__ */ jsxs9(CardHeader, {
3610
3610
  className: cn("relative", hasRowActionMenu(store) && "pr-12"),
3611
3611
  children: [
3612
- selection || draggable || tagIds.length ? /* @__PURE__ */ jsxs9("div", {
3613
- className: "flex flex-wrap items-center gap-2",
3612
+ selection || draggable ? /* @__PURE__ */ jsxs9("div", {
3613
+ className: "flex items-center gap-2",
3614
3614
  children: [
3615
3615
  selection ? /* @__PURE__ */ jsx15(Checkbox, {
3616
3616
  "aria-label": store.config.labels.selectRow,
@@ -3621,22 +3621,25 @@ var GalleryCard = ({
3621
3621
  }) : null,
3622
3622
  draggable ? /* @__PURE__ */ jsx15(DragHandle, {
3623
3623
  tableAtom
3624
- }) : null,
3625
- tagIds.map((id) => {
3626
- const column = find(id);
3627
- return column ? /* @__PURE__ */ jsx15(GalleryTag, {
3628
- row,
3629
- column,
3630
- locale: store.config.locale,
3631
- labels: store.config.labels,
3632
- icon: id === gallery.tag ? gallery.tagIcon : undefined
3633
- }, id) : null;
3634
- })
3624
+ }) : null
3635
3625
  ]
3636
3626
  }) : null,
3637
3627
  /* @__PURE__ */ jsx15(CardTitle, {
3638
3628
  children: name ? renderCell(row, name, store.config.locale, store.config.labels) : row.id
3639
3629
  }),
3630
+ tagIds.length ? /* @__PURE__ */ jsx15("div", {
3631
+ className: "flex flex-wrap items-center gap-2",
3632
+ children: tagIds.map((id) => {
3633
+ const column = find(id);
3634
+ return column ? /* @__PURE__ */ jsx15(GalleryTag, {
3635
+ row,
3636
+ column,
3637
+ locale: store.config.locale,
3638
+ labels: store.config.labels,
3639
+ icon: id === gallery.tag ? gallery.tagIcon : undefined
3640
+ }, id) : null;
3641
+ })
3642
+ }) : null,
3640
3643
  description ? /* @__PURE__ */ jsx15("div", {
3641
3644
  className: "text-muted-foreground line-clamp-3 text-sm",
3642
3645
  children: renderCell(row, description, store.config.locale, store.config.labels)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krak-stack/registry",
3
- "version": "0.10.4",
3
+ "version": "0.10.6",
4
4
  "description": "Tree-shakable KrakStack components and Effect services.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -17,6 +17,34 @@
17
17
  "type": "module",
18
18
  "sideEffects": false,
19
19
  "exports": {
20
+ "./rich-text-editor": {
21
+ "types": "./dist/components/ui/rich-text-editor.d.ts",
22
+ "import": "./dist/components/ui/rich-text-editor.js"
23
+ },
24
+ "./rich-text/schema": {
25
+ "types": "./dist/lib/rich-text/schema.d.ts",
26
+ "import": "./dist/lib/rich-text/schema.js"
27
+ },
28
+ "./rich-text/model": {
29
+ "types": "./dist/lib/rich-text/model.d.ts",
30
+ "import": "./dist/lib/rich-text/model.js"
31
+ },
32
+ "./email-editor": {
33
+ "types": "./dist/components/ui/email-editor.d.ts",
34
+ "import": "./dist/components/ui/email-editor.js"
35
+ },
36
+ "./email-document/schema": {
37
+ "types": "./dist/lib/email-document/schema.d.ts",
38
+ "import": "./dist/lib/email-document/schema.js"
39
+ },
40
+ "./email-document/model": {
41
+ "types": "./dist/lib/email-document/model.d.ts",
42
+ "import": "./dist/lib/email-document/model.js"
43
+ },
44
+ "./email-document/render": {
45
+ "types": "./dist/lib/email-document/render.d.ts",
46
+ "import": "./dist/lib/email-document/render.js"
47
+ },
20
48
  "./time-picker": {
21
49
  "types": "./dist/components/ui/time-picker.d.ts",
22
50
  "import": "./dist/components/ui/time-picker.js"
@@ -426,7 +454,6 @@
426
454
  "effect": "^4.1.0",
427
455
  "libphonenumber-js": "^1.13.16",
428
456
  "lucide-react": "^1.18.0",
429
- "motion": "^14.12.0",
430
457
  "react": "^19.2.0",
431
458
  "react-dom": "^19.2.0"
432
459
  },
@@ -434,9 +461,6 @@
434
461
  "libphonenumber-js": {
435
462
  "optional": true
436
463
  },
437
- "motion": {
438
- "optional": true
439
- },
440
464
  "@effect/sql-pg": {
441
465
  "optional": true
442
466
  },