@jotx-labs/standard-lib 2.2.0 → 2.4.82

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 (45) hide show
  1. package/dist/blocks/Attachment.d.ts +1 -1
  2. package/dist/blocks/BlockRef.d.ts +1 -1
  3. package/dist/blocks/Button.d.ts +2 -0
  4. package/dist/blocks/Button.js +32 -0
  5. package/dist/blocks/Callout.d.ts +1 -1
  6. package/dist/blocks/Card.d.ts +2 -0
  7. package/dist/blocks/Card.js +28 -0
  8. package/dist/blocks/Cell.d.ts +1 -1
  9. package/dist/blocks/Chart.d.ts +1 -1
  10. package/dist/blocks/Chart.js +1 -0
  11. package/dist/blocks/Checklist.d.ts +1 -1
  12. package/dist/blocks/Code.d.ts +1 -1
  13. package/dist/blocks/CodeReference.d.ts +1 -1
  14. package/dist/blocks/DateTime.d.ts +1 -1
  15. package/dist/blocks/Divider.d.ts +1 -1
  16. package/dist/blocks/FloatImage.d.ts +1 -1
  17. package/dist/blocks/GridCard.d.ts +2 -0
  18. package/dist/blocks/GridCard.js +24 -0
  19. package/dist/blocks/Header.d.ts +1 -1
  20. package/dist/blocks/Heading.d.ts +1 -1
  21. package/dist/blocks/Image.d.ts +1 -1
  22. package/dist/blocks/JotxLink.d.ts +11 -1
  23. package/dist/blocks/JotxLink.js +16 -7
  24. package/dist/blocks/Link.d.ts +1 -1
  25. package/dist/blocks/LinkCard.d.ts +1 -1
  26. package/dist/blocks/List.d.ts +1 -1
  27. package/dist/blocks/Math.d.ts +1 -1
  28. package/dist/blocks/Math.js +1 -0
  29. package/dist/blocks/Mermaid.d.ts +1 -1
  30. package/dist/blocks/Mermaid.js +1 -0
  31. package/dist/blocks/Paragraph.d.ts +1 -1
  32. package/dist/blocks/Properties.d.ts +1 -1
  33. package/dist/blocks/Properties.js +3 -1
  34. package/dist/blocks/Property.d.ts +1 -1
  35. package/dist/blocks/Quote.d.ts +1 -1
  36. package/dist/blocks/Row.d.ts +1 -1
  37. package/dist/blocks/Section.d.ts +1 -1
  38. package/dist/blocks/Table.d.ts +1 -1
  39. package/dist/blocks/Table.js +1 -0
  40. package/dist/blocks/Toggle.d.ts +1 -1
  41. package/dist/blocks/Video.d.ts +1 -1
  42. package/dist/index.d.ts +3 -0
  43. package/dist/index.js +13 -1
  44. package/dist/verify-stdlib.js +1 -1
  45. package/package.json +3 -3
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const AttachmentBlock: BlockDefinition;
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const BlockRefBlock: BlockDefinition;
@@ -0,0 +1,2 @@
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
+ export declare const ButtonBlock: BlockDefinition;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ButtonBlock = void 0;
4
+ exports.ButtonBlock = {
5
+ type: 'button',
6
+ syntax: {
7
+ keyword: 'button',
8
+ hasText: false
9
+ },
10
+ schema: {
11
+ properties: {
12
+ label: { type: 'string', required: true, description: 'Button text' },
13
+ link: { type: 'string', required: true, description: 'File path to navigate' },
14
+ style: {
15
+ type: 'enum',
16
+ required: false,
17
+ default: 'primary',
18
+ options: ['primary', 'secondary', 'outline', 'ghost']
19
+ },
20
+ align: {
21
+ type: 'enum',
22
+ required: false,
23
+ default: 'left',
24
+ options: ['left', 'center', 'right']
25
+ }
26
+ }
27
+ },
28
+ ui: {
29
+ label: 'Button',
30
+ icon: 'play'
31
+ }
32
+ };
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const CalloutBlock: BlockDefinition;
@@ -0,0 +1,2 @@
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
+ export declare const CardBlock: BlockDefinition;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CardBlock = void 0;
4
+ exports.CardBlock = {
5
+ type: 'card',
6
+ syntax: {
7
+ keyword: 'card',
8
+ hasText: false
9
+ },
10
+ schema: {
11
+ properties: {
12
+ title: { type: 'string', required: true, description: 'Card title' },
13
+ value: { type: 'string', required: false, description: 'Stat value' },
14
+ icon: { type: 'string', required: false, description: 'Emoji icon' },
15
+ color: {
16
+ type: 'enum',
17
+ required: false,
18
+ default: 'teal',
19
+ options: ['blue', 'green', 'red', 'yellow', 'purple', 'teal', 'gray']
20
+ },
21
+ link: { type: 'string', required: false, description: 'File path to navigate' }
22
+ }
23
+ },
24
+ ui: {
25
+ label: 'Card',
26
+ icon: 'credit-card'
27
+ }
28
+ };
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const CellBlock: BlockDefinition;
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const ChartBlock: BlockDefinition;
@@ -9,6 +9,7 @@ exports.ChartBlock = {
9
9
  },
10
10
  schema: {
11
11
  properties: {
12
+ title: { type: 'string', required: false, description: 'Chart title' },
12
13
  charttype: {
13
14
  type: 'enum',
14
15
  required: true,
@@ -1,3 +1,3 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const ChecklistBlock: BlockDefinition;
3
3
  export declare const TaskItemBlock: BlockDefinition;
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const CodeBlock: BlockDefinition;
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const CodeReferenceBlock: BlockDefinition;
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const DateTimeBlock: BlockDefinition;
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const DividerBlock: BlockDefinition;
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const FloatImageBlock: BlockDefinition;
@@ -0,0 +1,2 @@
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
+ export declare const GridCardBlock: BlockDefinition;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GridCardBlock = void 0;
4
+ exports.GridCardBlock = {
5
+ type: 'gridcard',
6
+ syntax: {
7
+ keyword: 'gridcard',
8
+ hasText: false
9
+ },
10
+ schema: {
11
+ properties: {
12
+ layout: {
13
+ type: 'enum',
14
+ required: false,
15
+ default: '2x2',
16
+ options: ['1x1', '1x2', '2x1', '2x2', '2x3', '3x2', '3x3']
17
+ }
18
+ }
19
+ },
20
+ ui: {
21
+ label: 'Grid Card',
22
+ icon: 'grid'
23
+ }
24
+ };
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const HeaderBlock: BlockDefinition;
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const HeadingBlock: BlockDefinition;
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const ImageBlock: BlockDefinition;
@@ -1,2 +1,12 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
+ /**
3
+ * JotxLink Block - Reference to another block or document
4
+ * Syntax: def jotxlink abc123
5
+ * ref TYPE ID
6
+ *
7
+ * Examples:
8
+ * ref mermaid xyz789 - Reference to mermaid block
9
+ * ref def abc123 - Reference to def block
10
+ * ref jotx doc_id - Reference to document (hdef)
11
+ */
2
12
  export declare const JotxLinkBlock: BlockDefinition;
@@ -1,22 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.JotxLinkBlock = void 0;
4
+ /**
5
+ * JotxLink Block - Reference to another block or document
6
+ * Syntax: def jotxlink abc123
7
+ * ref TYPE ID
8
+ *
9
+ * Examples:
10
+ * ref mermaid xyz789 - Reference to mermaid block
11
+ * ref def abc123 - Reference to def block
12
+ * ref jotx doc_id - Reference to document (hdef)
13
+ */
4
14
  exports.JotxLinkBlock = {
5
15
  type: 'jotxlink',
6
16
  syntax: {
7
17
  keyword: 'jotxlink',
8
- hasText: false, // Text is property, not content body? Wait, V3 usually puts text in properties or body. Let's check spec.
9
- // Spec: def jotxlink jl1 { target "doc-id"; text "Display Text" }
10
- // Markdown: [[target]]
18
+ hasText: false
11
19
  },
12
20
  schema: {
13
21
  properties: {
14
- target: { type: 'string', required: true, description: 'Target document ID or path' },
15
- text: { type: 'string', required: false, description: 'Display text' }
22
+ reftype: { type: 'identifier', required: true, description: 'Type of referenced block (def, mermaid, code, jotx, etc.)' },
23
+ refid: { type: 'identifier', required: true, description: 'ShortUUID of referenced block or document' }
16
24
  }
17
25
  },
18
26
  ui: {
19
- label: 'Jotx Link',
20
- icon: 'link-2' // Lucide icon
27
+ label: 'Reference Link',
28
+ icon: 'link-2', // Lucide icon
29
+ description: 'Link to another block or document'
21
30
  }
22
31
  };
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const LinkBlock: BlockDefinition;
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const LinkCardBlock: BlockDefinition;
@@ -1,3 +1,3 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const ListBlock: BlockDefinition;
3
3
  export declare const ListItemBlock: BlockDefinition;
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const MathBlock: BlockDefinition;
@@ -9,6 +9,7 @@ exports.MathBlock = {
9
9
  },
10
10
  schema: {
11
11
  properties: {
12
+ title: { type: 'string', required: false, description: 'Equation title' },
12
13
  src: { type: 'string', required: true },
13
14
  display: { type: 'enum', options: ['block', 'inline'], default: 'block' },
14
15
  showsource: { type: 'boolean', default: false }
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const MermaidBlock: BlockDefinition;
@@ -9,6 +9,7 @@ exports.MermaidBlock = {
9
9
  },
10
10
  schema: {
11
11
  properties: {
12
+ title: { type: 'string', required: false, description: 'Diagram title' },
12
13
  src: { type: 'string', required: true },
13
14
  showsource: { type: 'boolean', default: false }
14
15
  }
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const ParagraphBlock: BlockDefinition;
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const PropertiesBlock: BlockDefinition;
@@ -8,7 +8,9 @@ exports.PropertiesBlock = {
8
8
  hasChildren: true
9
9
  },
10
10
  schema: {
11
- properties: {}
11
+ properties: {
12
+ title: { type: 'string', required: false, description: 'Property table title' }
13
+ }
12
14
  },
13
15
  ui: {
14
16
  label: 'Properties',
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const PropertyBlock: BlockDefinition;
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const QuoteBlock: BlockDefinition;
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const RowBlock: BlockDefinition;
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const SectionBlock: BlockDefinition;
@@ -1,4 +1,4 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const TableBlock: BlockDefinition;
3
3
  export declare const TableRowBlock: BlockDefinition;
4
4
  export declare const TableCellBlock: BlockDefinition;
@@ -8,6 +8,7 @@ exports.TableBlock = {
8
8
  },
9
9
  schema: {
10
10
  properties: {
11
+ title: { type: 'string', required: false, description: 'Table title' },
11
12
  columns: { type: 'string', required: false } // Legacy prop, ideally derived from headers
12
13
  }
13
14
  },
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const ToggleBlock: BlockDefinition;
@@ -1,2 +1,2 @@
1
- import { BlockDefinition } from '@jotx/registry';
1
+ import { BlockDefinition } from '@jotx-labs/registry';
2
2
  export declare const VideoBlock: BlockDefinition;
package/dist/index.d.ts CHANGED
@@ -28,3 +28,6 @@ export * from './blocks/BlockRef';
28
28
  export * from './blocks/Row';
29
29
  export * from './blocks/Cell';
30
30
  export * from './blocks/Header';
31
+ export * from './blocks/GridCard';
32
+ export * from './blocks/Card';
33
+ export * from './blocks/Button';
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.registerStandardBlocks = registerStandardBlocks;
18
- const registry_1 = require("@jotx/registry");
18
+ const registry_1 = require("@jotx-labs/registry");
19
19
  // Import all blocks
20
20
  const Paragraph_1 = require("./blocks/Paragraph");
21
21
  const Heading_1 = require("./blocks/Heading");
@@ -46,6 +46,9 @@ const BlockRef_1 = require("./blocks/BlockRef");
46
46
  const Row_1 = require("./blocks/Row");
47
47
  const Cell_1 = require("./blocks/Cell");
48
48
  const Header_1 = require("./blocks/Header");
49
+ const GridCard_1 = require("./blocks/GridCard");
50
+ const Card_1 = require("./blocks/Card");
51
+ const Button_1 = require("./blocks/Button");
49
52
  function registerStandardBlocks() {
50
53
  // Text blocks
51
54
  registry_1.registry.register(Paragraph_1.ParagraphBlock);
@@ -88,6 +91,12 @@ function registerStandardBlocks() {
88
91
  registry_1.registry.register(Row_1.RowBlock);
89
92
  registry_1.registry.register(Cell_1.CellBlock);
90
93
  registry_1.registry.register(Header_1.HeaderBlock);
94
+ // Navigation blocks
95
+ registry_1.registry.register(GridCard_1.GridCardBlock);
96
+ registry_1.registry.register(Card_1.CardBlock);
97
+ registry_1.registry.register(Button_1.ButtonBlock);
98
+ // DEBUG: Log registry state
99
+ console.log('[StandardLib] Registered standard blocks. Registry keys:', registry_1.registry.getAll().map(b => b.type).join(', '));
91
100
  }
92
101
  // Export all blocks
93
102
  __exportStar(require("./blocks/Paragraph"), exports);
@@ -119,3 +128,6 @@ __exportStar(require("./blocks/BlockRef"), exports);
119
128
  __exportStar(require("./blocks/Row"), exports);
120
129
  __exportStar(require("./blocks/Cell"), exports);
121
130
  __exportStar(require("./blocks/Header"), exports);
131
+ __exportStar(require("./blocks/GridCard"), exports);
132
+ __exportStar(require("./blocks/Card"), exports);
133
+ __exportStar(require("./blocks/Button"), exports);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const index_1 = require("./index");
4
- const registry_1 = require("@jotx/registry");
4
+ const registry_1 = require("@jotx-labs/registry");
5
5
  console.log('🚀 Verifying Standard Library...');
6
6
  registry_1.registry.clear();
7
7
  (0, index_1.registerStandardBlocks)();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jotx-labs/standard-lib",
3
- "version": "2.2.0",
3
+ "version": "2.4.82",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -19,9 +19,9 @@
19
19
  "author": "balajiboominathan",
20
20
  "license": "Apache-2.0",
21
21
  "dependencies": {
22
- "@jotx/registry": "file:../registry"
22
+ "@jotx-labs/registry": "file:../registry"
23
23
  },
24
24
  "devDependencies": {
25
25
  "typescript": "^5.0.0"
26
26
  }
27
- }
27
+ }