@ankhorage/zora 25.11.1 → 26.0.0

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 (82) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -4
  3. package/dist/capabilities/index.js +65 -41
  4. package/dist/capabilities/index.js.map +3 -3
  5. package/dist/features/chess/adapters/inbound/ChessBoard.d.ts +1 -1
  6. package/dist/features/chess/adapters/inbound/ChessBoard.d.ts.map +1 -1
  7. package/dist/features/chess/adapters/inbound/ChessBoard.js +130 -83
  8. package/dist/features/chess/adapters/inbound/ChessBoard.js.map +1 -1
  9. package/dist/features/chess/meta.d.ts +97 -72
  10. package/dist/features/chess/meta.d.ts.map +1 -1
  11. package/dist/features/chess/meta.js +64 -40
  12. package/dist/features/chess/meta.js.map +1 -1
  13. package/dist/features/chess/public.d.ts +1 -7
  14. package/dist/features/chess/public.d.ts.map +1 -1
  15. package/dist/features/chess/public.js +0 -6
  16. package/dist/features/chess/public.js.map +1 -1
  17. package/dist/features/chess/utils/createChessBoardCellPressHandler.d.ts +6 -0
  18. package/dist/features/chess/utils/createChessBoardCellPressHandler.d.ts.map +1 -0
  19. package/dist/features/chess/utils/createChessBoardCellPressHandler.js +17 -0
  20. package/dist/features/chess/utils/createChessBoardCellPressHandler.js.map +1 -0
  21. package/dist/features/chess/utils/createChessBoardCells.d.ts +12 -0
  22. package/dist/features/chess/utils/createChessBoardCells.d.ts.map +1 -0
  23. package/dist/features/chess/utils/createChessBoardCells.js +28 -0
  24. package/dist/features/chess/utils/createChessBoardCells.js.map +1 -0
  25. package/dist/readerFree.d.ts +2 -2
  26. package/dist/readerFree.d.ts.map +1 -1
  27. package/dist/readerFree.js +1 -1
  28. package/dist/readerFree.js.map +1 -1
  29. package/dist/types/authoring.d.ts +2 -1
  30. package/dist/types/authoring.d.ts.map +1 -1
  31. package/dist/types/authoring.js.map +1 -1
  32. package/dist/types/chess.d.ts +27 -20
  33. package/dist/types/chess.d.ts.map +1 -1
  34. package/dist/types/chess.js.map +1 -1
  35. package/package.json +31 -92
  36. package/src/features/chess/adapters/inbound/ChessBoard.tsx +263 -112
  37. package/src/features/chess/meta.ts +64 -40
  38. package/src/features/chess/public.test.tsx +77 -228
  39. package/src/features/chess/public.ts +2 -9
  40. package/src/features/chess/utils/createChessBoardCellPressHandler.ts +30 -0
  41. package/src/features/chess/utils/createChessBoardCells.ts +54 -0
  42. package/src/features/chessTabletopOwnership.test.ts +3 -7
  43. package/src/features/registry/componentMeta.test.ts +12 -1
  44. package/src/readerFree.ts +3 -15
  45. package/src/types/authoring.ts +2 -1
  46. package/src/types/chess.ts +28 -21
  47. package/web-dist/chunks/Accordion-91sjb3zh.js +453 -0
  48. package/web-dist/components/chess-board/ChessBoard.js +2 -1
  49. package/web-dist/components/opening-book/OpeningBook.js +2 -1
  50. package/web-dist/manifest.json +8 -4
  51. package/dist/features/chess/utils/chessEngine.d.ts +0 -8
  52. package/dist/features/chess/utils/chessEngine.d.ts.map +0 -1
  53. package/dist/features/chess/utils/chessEngine.js +0 -71
  54. package/dist/features/chess/utils/chessEngine.js.map +0 -1
  55. package/dist/features/chess/utils/chessSquares.d.ts +0 -4
  56. package/dist/features/chess/utils/chessSquares.d.ts.map +0 -1
  57. package/dist/features/chess/utils/chessSquares.js +0 -3
  58. package/dist/features/chess/utils/chessSquares.js.map +0 -1
  59. package/dist/features/chess/utils/createBoardSquares.d.ts +0 -4
  60. package/dist/features/chess/utils/createBoardSquares.d.ts.map +0 -1
  61. package/dist/features/chess/utils/createBoardSquares.js +0 -9
  62. package/dist/features/chess/utils/createBoardSquares.js.map +0 -1
  63. package/dist/features/chess/utils/getSquareFile.d.ts +0 -4
  64. package/dist/features/chess/utils/getSquareFile.d.ts.map +0 -1
  65. package/dist/features/chess/utils/getSquareFile.js +0 -5
  66. package/dist/features/chess/utils/getSquareFile.js.map +0 -1
  67. package/dist/features/chess/utils/getSquareRank.d.ts +0 -4
  68. package/dist/features/chess/utils/getSquareRank.d.ts.map +0 -1
  69. package/dist/features/chess/utils/getSquareRank.js +0 -5
  70. package/dist/features/chess/utils/getSquareRank.js.map +0 -1
  71. package/dist/features/chess/utils/isLightSquare.d.ts +0 -4
  72. package/dist/features/chess/utils/isLightSquare.d.ts.map +0 -1
  73. package/dist/features/chess/utils/isLightSquare.js +0 -6
  74. package/dist/features/chess/utils/isLightSquare.js.map +0 -1
  75. package/src/features/chess/utils/chessEngine.test.ts +0 -35
  76. package/src/features/chess/utils/chessEngine.ts +0 -83
  77. package/src/features/chess/utils/chessSquares.ts +0 -6
  78. package/src/features/chess/utils/createBoardSquares.ts +0 -13
  79. package/src/features/chess/utils/getSquareFile.ts +0 -6
  80. package/src/features/chess/utils/getSquareRank.ts +0 -6
  81. package/src/features/chess/utils/isLightSquare.ts +0 -8
  82. package/web-dist/chunks/Accordion-xcm1qc39.js +0 -3813
@@ -2,28 +2,31 @@ import type React from 'react';
2
2
  import type { ZoraBaseProps } from './base';
3
3
  export type ChessBoardOrientation = 'white' | 'black';
4
4
  export type ChessPieceCode = string;
5
- export type ChessSquareId = `${'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h'}${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8}`;
6
- export type ChessPromotionPiece = 'q' | 'r' | 'b' | 'n';
7
- export interface ChessMoveAttempt {
8
- readonly from: ChessSquareId;
9
- readonly to: ChessSquareId;
10
- readonly promotion?: ChessPromotionPiece;
5
+ /** A caller-owned cell location in a rectangular chess presentation board. */
6
+ export interface ChessBoardCell {
7
+ readonly column: number;
8
+ readonly row: number;
11
9
  }
12
- export interface ChessMoveResult extends Omit<ChessMoveAttempt, 'promotion'> {
13
- readonly fen: string;
14
- readonly lan: string;
15
- readonly promotion?: ChessPromotionPiece;
16
- readonly san: string;
10
+ /** The bounded presentation dimensions supported by ChessBoard. */
11
+ export interface ChessBoardDimensions {
12
+ readonly columns: number;
13
+ readonly rows: number;
14
+ }
15
+ export interface ChessMoveAttempt {
16
+ readonly from: ChessBoardCell;
17
+ readonly to: ChessBoardCell;
17
18
  }
18
19
  export interface ChessPieceState {
19
20
  readonly color: 'black' | 'white';
20
21
  readonly piece: ChessPieceCode;
21
- readonly square: ChessSquareId;
22
+ readonly cell: ChessBoardCell;
22
23
  }
23
24
  export interface ChessPieceRenderContext {
24
25
  readonly color: string;
25
26
  readonly piece: ChessPieceCode;
26
- readonly square: ChessSquareId;
27
+ readonly cell: ChessBoardCell;
28
+ /** Available cell edge length in pixels. */
29
+ readonly size: number;
27
30
  }
28
31
  export type ChessPieceRenderer = (context: ChessPieceRenderContext) => React.ReactNode;
29
32
  export interface ChessBoardColorScheme {
@@ -53,20 +56,24 @@ export interface OpeningBookColorScheme {
53
56
  }
54
57
  export type OpeningBookColorOverrides = Partial<OpeningBookColorScheme>;
55
58
  export interface ChessBoardProps extends ZoraBaseProps {
56
- readonly fen?: string;
59
+ /** Number of displayed columns, from 2 through 24. */
60
+ readonly columns?: number;
61
+ /** Number of displayed rows, from 2 through 24. */
62
+ readonly rows?: number;
57
63
  readonly pieces?: readonly ChessPieceState[];
58
64
  readonly orientation?: ChessBoardOrientation;
59
- readonly selectedSquare?: ChessSquareId | null;
60
- readonly legalTargets?: readonly ChessSquareId[];
65
+ readonly selectedCell?: ChessBoardCell | null;
66
+ readonly legalTargets?: readonly ChessBoardCell[];
61
67
  readonly lastMove?: ChessMoveAttempt | null;
62
68
  readonly disabled?: boolean;
63
69
  readonly showCoordinates?: boolean;
64
- readonly validateMoves?: boolean;
70
+ /** Enables explicit editor resize controls when a dimensions callback is supplied. */
71
+ readonly resizable?: boolean;
65
72
  readonly colorScheme?: ChessBoardColorOverrides;
66
- readonly onSquarePress?: (square: ChessSquareId) => void;
73
+ readonly onCellPress?: (cell: ChessBoardCell) => void;
67
74
  readonly onMoveAttempt?: (move: ChessMoveAttempt) => void;
68
- readonly onLegalMove?: (move: ChessMoveResult) => void;
69
- readonly onInvalidMove?: (move: ChessMoveAttempt) => void;
75
+ /** Receives a caller-owned resize proposal; ZORA never mutates board dimensions. */
76
+ readonly onDimensionsChange?: (dimensions: ChessBoardDimensions) => void;
70
77
  readonly renderPiece?: ChessPieceRenderer;
71
78
  }
72
79
  export interface OpeningBookMove {
@@ -1 +1 @@
1
- {"version":3,"file":"chess.d.ts","sourceRoot":"","sources":["../../src/types/chess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,OAAO,CAAC;AACtD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AACpC,MAAM,MAAM,aAAa,GACvB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;AACrF,MAAM,MAAM,mBAAmB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAExD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,EAAE,EAAE,aAAa,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,mBAAmB,CAAC;CAC1C;AAED,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC;IAC1E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,mBAAmB,CAAC;IACzC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAA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,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,WAAW,CAAC,EAAE,yBAAyB,CAAC;IACjD,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;CACxD"}
@@ -1 +1 @@
1
- {"version":3,"file":"chess.js","sourceRoot":"","sources":["../../src/types/chess.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ZoraBaseProps } from './base';\n\nexport type ChessBoardOrientation = 'white' | 'black';\nexport type ChessPieceCode = string;\nexport type ChessSquareId =\n `${'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h'}${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8}`;\nexport type ChessPromotionPiece = 'q' | 'r' | 'b' | 'n';\n\nexport interface ChessMoveAttempt {\n readonly from: ChessSquareId;\n readonly to: ChessSquareId;\n readonly promotion?: ChessPromotionPiece;\n}\n\nexport interface ChessMoveResult extends Omit<ChessMoveAttempt, 'promotion'> {\n readonly fen: string;\n readonly lan: string;\n readonly promotion?: ChessPromotionPiece;\n readonly san: string;\n}\n\nexport interface ChessPieceState {\n readonly color: 'black' | 'white';\n readonly piece: ChessPieceCode;\n readonly square: ChessSquareId;\n}\n\nexport interface ChessPieceRenderContext {\n readonly color: string;\n readonly piece: ChessPieceCode;\n readonly square: ChessSquareId;\n}\n\nexport type ChessPieceRenderer = (context: ChessPieceRenderContext) => React.ReactNode;\n\nexport interface ChessBoardColorScheme {\n readonly lightSquare: string;\n readonly darkSquare: string;\n readonly lightSquareText: string;\n readonly darkSquareText: string;\n readonly selectedSquare: string;\n readonly legalTarget: string;\n readonly lastMoveFrom: string;\n readonly lastMoveTo: string;\n readonly border: string;\n readonly coordinateText: string;\n readonly lightPiece: string;\n readonly darkPiece: string;\n}\n\nexport type ChessBoardColorOverrides = Partial<ChessBoardColorScheme>;\n\nexport interface OpeningBookColorScheme {\n readonly border: string;\n readonly surface: string;\n readonly surfaceHover: string;\n readonly selectedSurface: string;\n readonly titleText: string;\n readonly primaryText: string;\n readonly secondaryText: string;\n readonly metricSurface: string;\n}\nexport type OpeningBookColorOverrides = Partial<OpeningBookColorScheme>;\n\nexport interface ChessBoardProps extends ZoraBaseProps {\n readonly fen?: string;\n readonly pieces?: readonly ChessPieceState[];\n readonly orientation?: ChessBoardOrientation;\n readonly selectedSquare?: ChessSquareId | null;\n readonly legalTargets?: readonly ChessSquareId[];\n readonly lastMove?: ChessMoveAttempt | null;\n readonly disabled?: boolean;\n readonly showCoordinates?: boolean;\n readonly validateMoves?: boolean;\n readonly colorScheme?: ChessBoardColorOverrides;\n readonly onSquarePress?: (square: ChessSquareId) => void;\n readonly onMoveAttempt?: (move: ChessMoveAttempt) => void;\n readonly onLegalMove?: (move: ChessMoveResult) => void;\n readonly onInvalidMove?: (move: ChessMoveAttempt) => void;\n readonly renderPiece?: ChessPieceRenderer;\n}\n\nexport interface OpeningBookMove {\n readonly san: string;\n readonly uci?: string;\n readonly fen?: string;\n readonly name?: string;\n readonly eco?: string;\n readonly games?: number;\n readonly whiteWinRate?: number;\n readonly drawRate?: number;\n readonly blackWinRate?: number;\n}\n\nexport interface OpeningBookProps extends ZoraBaseProps {\n readonly moves?: readonly OpeningBookMove[];\n readonly title?: string;\n readonly loading?: boolean;\n readonly errorText?: string;\n readonly emptyText?: string;\n readonly selectedMove?: string | null;\n readonly colorScheme?: OpeningBookColorOverrides;\n readonly onMovePress?: (move: OpeningBookMove) => void;\n}\n"]}
1
+ {"version":3,"file":"chess.js","sourceRoot":"","sources":["../../src/types/chess.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ZoraBaseProps } from './base';\n\nexport type ChessBoardOrientation = 'white' | 'black';\nexport type ChessPieceCode = string;\n\n/** A caller-owned cell location in a rectangular chess presentation board. */\nexport interface ChessBoardCell {\n readonly column: number;\n readonly row: number;\n}\n\n/** The bounded presentation dimensions supported by ChessBoard. */\nexport interface ChessBoardDimensions {\n readonly columns: number;\n readonly rows: number;\n}\n\nexport interface ChessMoveAttempt {\n readonly from: ChessBoardCell;\n readonly to: ChessBoardCell;\n}\n\nexport interface ChessPieceState {\n readonly color: 'black' | 'white';\n readonly piece: ChessPieceCode;\n readonly cell: ChessBoardCell;\n}\n\nexport interface ChessPieceRenderContext {\n readonly color: string;\n readonly piece: ChessPieceCode;\n readonly cell: ChessBoardCell;\n /** Available cell edge length in pixels. */\n readonly size: number;\n}\n\nexport type ChessPieceRenderer = (context: ChessPieceRenderContext) => React.ReactNode;\n\nexport interface ChessBoardColorScheme {\n readonly lightSquare: string;\n readonly darkSquare: string;\n readonly lightSquareText: string;\n readonly darkSquareText: string;\n readonly selectedSquare: string;\n readonly legalTarget: string;\n readonly lastMoveFrom: string;\n readonly lastMoveTo: string;\n readonly border: string;\n readonly coordinateText: string;\n readonly lightPiece: string;\n readonly darkPiece: string;\n}\n\nexport type ChessBoardColorOverrides = Partial<ChessBoardColorScheme>;\n\nexport interface OpeningBookColorScheme {\n readonly border: string;\n readonly surface: string;\n readonly surfaceHover: string;\n readonly selectedSurface: string;\n readonly titleText: string;\n readonly primaryText: string;\n readonly secondaryText: string;\n readonly metricSurface: string;\n}\nexport type OpeningBookColorOverrides = Partial<OpeningBookColorScheme>;\n\nexport interface ChessBoardProps extends ZoraBaseProps {\n /** Number of displayed columns, from 2 through 24. */\n readonly columns?: number;\n /** Number of displayed rows, from 2 through 24. */\n readonly rows?: number;\n readonly pieces?: readonly ChessPieceState[];\n readonly orientation?: ChessBoardOrientation;\n readonly selectedCell?: ChessBoardCell | null;\n readonly legalTargets?: readonly ChessBoardCell[];\n readonly lastMove?: ChessMoveAttempt | null;\n readonly disabled?: boolean;\n readonly showCoordinates?: boolean;\n /** Enables explicit editor resize controls when a dimensions callback is supplied. */\n readonly resizable?: boolean;\n readonly colorScheme?: ChessBoardColorOverrides;\n readonly onCellPress?: (cell: ChessBoardCell) => void;\n readonly onMoveAttempt?: (move: ChessMoveAttempt) => void;\n /** Receives a caller-owned resize proposal; ZORA never mutates board dimensions. */\n readonly onDimensionsChange?: (dimensions: ChessBoardDimensions) => void;\n readonly renderPiece?: ChessPieceRenderer;\n}\n\nexport interface OpeningBookMove {\n readonly san: string;\n readonly uci?: string;\n readonly fen?: string;\n readonly name?: string;\n readonly eco?: string;\n readonly games?: number;\n readonly whiteWinRate?: number;\n readonly drawRate?: number;\n readonly blackWinRate?: number;\n}\n\nexport interface OpeningBookProps extends ZoraBaseProps {\n readonly moves?: readonly OpeningBookMove[];\n readonly title?: string;\n readonly loading?: boolean;\n readonly errorText?: string;\n readonly emptyText?: string;\n readonly selectedMove?: string | null;\n readonly colorScheme?: OpeningBookColorOverrides;\n readonly onMovePress?: (move: OpeningBookMove) => void;\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/zora",
3
3
  "type": "module",
4
- "version": "25.11.1",
4
+ "version": "26.0.0",
5
5
  "description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
6
6
  "homepage": "https://github.com/ankhorage/zora#readme",
7
7
  "bugs": {
@@ -51,7 +51,6 @@
51
51
  "@ankhorage/runtime": "^5.2.4",
52
52
  "@ankhorage/surface": "^9.4.15",
53
53
  "@ankhorage/utility": "^1.10.0",
54
- "chess.js": "^1.4.0",
55
54
  "expo-document-picker": "~57.0.3",
56
55
  "expo-image-picker": "~57.0.20"
57
56
  },
@@ -529,7 +528,7 @@
529
528
  }
530
529
  },
531
530
  {
532
- "id": "chess.invalidMove",
531
+ "id": "chess.cellPress",
533
532
  "owner": "@ankhorage/zora",
534
533
  "access": [
535
534
  "emit"
@@ -540,67 +539,18 @@
540
539
  "source"
541
540
  ]
542
541
  },
543
- "label": "Invalid move",
542
+ "label": "Cell press",
544
543
  "output": {
545
544
  "schema": {
546
545
  "type": "object",
547
546
  "properties": {
548
- "from": {
549
- "type": "string",
550
- "title": "From"
551
- },
552
- "to": {
553
- "type": "string",
554
- "title": "To"
555
- },
556
- "promotion": {
557
- "type": "string",
558
- "title": "Promotion"
559
- }
560
- }
561
- }
562
- }
563
- },
564
- {
565
- "id": "chess.legalMove",
566
- "owner": "@ankhorage/zora",
567
- "access": [
568
- "emit"
569
- ],
570
- "binding": {
571
- "kind": "event",
572
- "bindableAs": [
573
- "source"
574
- ]
575
- },
576
- "label": "Legal move",
577
- "output": {
578
- "schema": {
579
- "type": "object",
580
- "properties": {
581
- "from": {
582
- "type": "string",
583
- "title": "From"
584
- },
585
- "to": {
586
- "type": "string",
587
- "title": "To"
588
- },
589
- "fen": {
590
- "type": "string",
591
- "title": "Position"
592
- },
593
- "san": {
594
- "type": "string",
595
- "title": "SAN"
596
- },
597
- "lan": {
598
- "type": "string",
599
- "title": "LAN"
547
+ "column": {
548
+ "type": "number",
549
+ "title": "Column"
600
550
  },
601
- "promotion": {
602
- "type": "string",
603
- "title": "Promotion"
551
+ "row": {
552
+ "type": "number",
553
+ "title": "Row"
604
554
  }
605
555
  }
606
556
  }
@@ -624,16 +574,30 @@
624
574
  "type": "object",
625
575
  "properties": {
626
576
  "from": {
627
- "type": "string",
628
- "title": "From"
577
+ "type": "object",
578
+ "properties": {
579
+ "column": {
580
+ "type": "number",
581
+ "title": "From column"
582
+ },
583
+ "row": {
584
+ "type": "number",
585
+ "title": "From row"
586
+ }
587
+ }
629
588
  },
630
589
  "to": {
631
- "type": "string",
632
- "title": "To"
633
- },
634
- "promotion": {
635
- "type": "string",
636
- "title": "Promotion"
590
+ "type": "object",
591
+ "properties": {
592
+ "column": {
593
+ "type": "number",
594
+ "title": "To column"
595
+ },
596
+ "row": {
597
+ "type": "number",
598
+ "title": "To row"
599
+ }
600
+ }
637
601
  }
638
602
  }
639
603
  }
@@ -672,31 +636,6 @@
672
636
  }
673
637
  }
674
638
  },
675
- {
676
- "id": "chess.squarePress",
677
- "owner": "@ankhorage/zora",
678
- "access": [
679
- "emit"
680
- ],
681
- "binding": {
682
- "kind": "event",
683
- "bindableAs": [
684
- "source"
685
- ]
686
- },
687
- "label": "Square press",
688
- "output": {
689
- "schema": {
690
- "type": "object",
691
- "properties": {
692
- "square": {
693
- "type": "string",
694
- "title": "Square"
695
- }
696
- }
697
- }
698
- }
699
- },
700
639
  {
701
640
  "id": "chip.press",
702
641
  "owner": "@ankhorage/zora",