@krak-stack/registry 0.10.5 → 0.10.7

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.
@@ -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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krak-stack/registry",
3
- "version": "0.10.5",
3
+ "version": "0.10.7",
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
  },