@texonom/nreact 1.1.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 (185) hide show
  1. package/build/.tsbuildinfo +1 -0
  2. package/build/block.d.ts +21 -0
  3. package/build/block.d.ts.map +1 -0
  4. package/build/chunk-723T62SD.js +83 -0
  5. package/build/chunk-QXNFTOMG.js +2064 -0
  6. package/build/chunk-RGP7M4NM.js +2064 -0
  7. package/build/components/asset-wrapper.d.ts +7 -0
  8. package/build/components/asset-wrapper.d.ts.map +1 -0
  9. package/build/components/asset.d.ts +8 -0
  10. package/build/components/asset.d.ts.map +1 -0
  11. package/build/components/audio.d.ts +7 -0
  12. package/build/components/audio.d.ts.map +1 -0
  13. package/build/components/checkbox.d.ts +6 -0
  14. package/build/components/checkbox.d.ts.map +1 -0
  15. package/build/components/eoi.d.ts +8 -0
  16. package/build/components/eoi.d.ts.map +1 -0
  17. package/build/components/file.d.ts +7 -0
  18. package/build/components/file.d.ts.map +1 -0
  19. package/build/components/google-drive.d.ts +7 -0
  20. package/build/components/google-drive.d.ts.map +1 -0
  21. package/build/components/graceful-image.d.ts +4 -0
  22. package/build/components/graceful-image.d.ts.map +1 -0
  23. package/build/components/header.d.ts +16 -0
  24. package/build/components/header.d.ts.map +1 -0
  25. package/build/components/lazy-image.d.ts +14 -0
  26. package/build/components/lazy-image.d.ts.map +1 -0
  27. package/build/components/lite-youtube-embed.d.ts +14 -0
  28. package/build/components/lite-youtube-embed.d.ts.map +1 -0
  29. package/build/components/page-aside.d.ts +12 -0
  30. package/build/components/page-aside.d.ts.map +1 -0
  31. package/build/components/page-icon.d.ts +17 -0
  32. package/build/components/page-icon.d.ts.map +1 -0
  33. package/build/components/page-title.d.ts +13 -0
  34. package/build/components/page-title.d.ts.map +1 -0
  35. package/build/components/search-dialog.d.ts +26 -0
  36. package/build/components/search-dialog.d.ts.map +1 -0
  37. package/build/components/sync-pointer-block.d.ts +7 -0
  38. package/build/components/sync-pointer-block.d.ts.map +1 -0
  39. package/build/components/text.d.ts +18 -0
  40. package/build/components/text.d.ts.map +1 -0
  41. package/build/context.d.ts +62 -0
  42. package/build/context.d.ts.map +1 -0
  43. package/build/dev/chunk-DC3JZG5M.js +2065 -0
  44. package/build/dev/chunk-DC3JZG5M.js.map +1 -0
  45. package/build/dev/chunk-HLFRY3QP.js +2065 -0
  46. package/build/dev/chunk-HLFRY3QP.js.map +1 -0
  47. package/build/dev/chunk-JX5CEG3A.js +84 -0
  48. package/build/dev/chunk-JX5CEG3A.js.map +1 -0
  49. package/build/dev/index.js +48 -0
  50. package/build/dev/index.js.map +1 -0
  51. package/build/dev/third-party/code.js +142 -0
  52. package/build/dev/third-party/code.js.map +1 -0
  53. package/build/dev/third-party/collection.js +4513 -0
  54. package/build/dev/third-party/collection.js.map +1 -0
  55. package/build/dev/third-party/equation.js +37 -0
  56. package/build/dev/third-party/equation.js.map +1 -0
  57. package/build/dev/third-party/modal.js +8 -0
  58. package/build/dev/third-party/modal.js.map +1 -0
  59. package/build/dev/third-party/pdf.js +21 -0
  60. package/build/dev/third-party/pdf.js.map +1 -0
  61. package/build/icons/check.d.ts +4 -0
  62. package/build/icons/check.d.ts.map +1 -0
  63. package/build/icons/chevron-down-icon.d.ts +3 -0
  64. package/build/icons/chevron-down-icon.d.ts.map +1 -0
  65. package/build/icons/clear-icon.d.ts +3 -0
  66. package/build/icons/clear-icon.d.ts.map +1 -0
  67. package/build/icons/collection-view-board.d.ts +4 -0
  68. package/build/icons/collection-view-board.d.ts.map +1 -0
  69. package/build/icons/collection-view-calendar.d.ts +4 -0
  70. package/build/icons/collection-view-calendar.d.ts.map +1 -0
  71. package/build/icons/collection-view-gallery.d.ts +4 -0
  72. package/build/icons/collection-view-gallery.d.ts.map +1 -0
  73. package/build/icons/collection-view-icon.d.ts +9 -0
  74. package/build/icons/collection-view-icon.d.ts.map +1 -0
  75. package/build/icons/collection-view-list.d.ts +4 -0
  76. package/build/icons/collection-view-list.d.ts.map +1 -0
  77. package/build/icons/collection-view-table.d.ts +4 -0
  78. package/build/icons/collection-view-table.d.ts.map +1 -0
  79. package/build/icons/copy.d.ts +4 -0
  80. package/build/icons/copy.d.ts.map +1 -0
  81. package/build/icons/default-page-icon.d.ts +3 -0
  82. package/build/icons/default-page-icon.d.ts.map +1 -0
  83. package/build/icons/empty-icon.d.ts +3 -0
  84. package/build/icons/empty-icon.d.ts.map +1 -0
  85. package/build/icons/file-icon.d.ts +3 -0
  86. package/build/icons/file-icon.d.ts.map +1 -0
  87. package/build/icons/link-icon.d.ts +3 -0
  88. package/build/icons/link-icon.d.ts.map +1 -0
  89. package/build/icons/loading-icon.d.ts +3 -0
  90. package/build/icons/loading-icon.d.ts.map +1 -0
  91. package/build/icons/property-icon.d.ts +9 -0
  92. package/build/icons/property-icon.d.ts.map +1 -0
  93. package/build/icons/search-icon.d.ts +3 -0
  94. package/build/icons/search-icon.d.ts.map +1 -0
  95. package/build/icons/type-checkbox.d.ts +4 -0
  96. package/build/icons/type-checkbox.d.ts.map +1 -0
  97. package/build/icons/type-date.d.ts +4 -0
  98. package/build/icons/type-date.d.ts.map +1 -0
  99. package/build/icons/type-email.d.ts +4 -0
  100. package/build/icons/type-email.d.ts.map +1 -0
  101. package/build/icons/type-file.d.ts +4 -0
  102. package/build/icons/type-file.d.ts.map +1 -0
  103. package/build/icons/type-formula.d.ts +4 -0
  104. package/build/icons/type-formula.d.ts.map +1 -0
  105. package/build/icons/type-github.d.ts +4 -0
  106. package/build/icons/type-github.d.ts.map +1 -0
  107. package/build/icons/type-multi-select.d.ts +4 -0
  108. package/build/icons/type-multi-select.d.ts.map +1 -0
  109. package/build/icons/type-number.d.ts +4 -0
  110. package/build/icons/type-number.d.ts.map +1 -0
  111. package/build/icons/type-person-2.d.ts +4 -0
  112. package/build/icons/type-person-2.d.ts.map +1 -0
  113. package/build/icons/type-person.d.ts +4 -0
  114. package/build/icons/type-person.d.ts.map +1 -0
  115. package/build/icons/type-phone-number.d.ts +4 -0
  116. package/build/icons/type-phone-number.d.ts.map +1 -0
  117. package/build/icons/type-relation.d.ts +4 -0
  118. package/build/icons/type-relation.d.ts.map +1 -0
  119. package/build/icons/type-select.d.ts +4 -0
  120. package/build/icons/type-select.d.ts.map +1 -0
  121. package/build/icons/type-text.d.ts +4 -0
  122. package/build/icons/type-text.d.ts.map +1 -0
  123. package/build/icons/type-timestamp.d.ts +4 -0
  124. package/build/icons/type-timestamp.d.ts.map +1 -0
  125. package/build/icons/type-title.d.ts +4 -0
  126. package/build/icons/type-title.d.ts.map +1 -0
  127. package/build/icons/type-url.d.ts +4 -0
  128. package/build/icons/type-url.d.ts.map +1 -0
  129. package/build/index.d.ts +8 -0
  130. package/build/index.d.ts.map +1 -0
  131. package/build/index.js +47 -0
  132. package/build/map-image-url.d.ts +3 -0
  133. package/build/map-image-url.d.ts.map +1 -0
  134. package/build/map-page-url.d.ts +2 -0
  135. package/build/map-page-url.d.ts.map +1 -0
  136. package/build/next.d.ts +4 -0
  137. package/build/next.d.ts.map +1 -0
  138. package/build/renderer.d.ts +50 -0
  139. package/build/renderer.d.ts.map +1 -0
  140. package/build/third-party/code.d.ts +17 -0
  141. package/build/third-party/code.d.ts.map +1 -0
  142. package/build/third-party/code.js +141 -0
  143. package/build/third-party/collection-card.d.ts +4 -0
  144. package/build/third-party/collection-card.d.ts.map +1 -0
  145. package/build/third-party/collection-column-title.d.ts +6 -0
  146. package/build/third-party/collection-column-title.d.ts.map +1 -0
  147. package/build/third-party/collection-group.d.ts +4 -0
  148. package/build/third-party/collection-group.d.ts.map +1 -0
  149. package/build/third-party/collection-row.d.ts +8 -0
  150. package/build/third-party/collection-row.d.ts.map +1 -0
  151. package/build/third-party/collection-utils.d.ts +2 -0
  152. package/build/third-party/collection-utils.d.ts.map +1 -0
  153. package/build/third-party/collection-view-board.d.ts +4 -0
  154. package/build/third-party/collection-view-board.d.ts.map +1 -0
  155. package/build/third-party/collection-view-gallery.d.ts +4 -0
  156. package/build/third-party/collection-view-gallery.d.ts.map +1 -0
  157. package/build/third-party/collection-view-list.d.ts +4 -0
  158. package/build/third-party/collection-view-list.d.ts.map +1 -0
  159. package/build/third-party/collection-view-table.d.ts +4 -0
  160. package/build/third-party/collection-view-table.d.ts.map +1 -0
  161. package/build/third-party/collection-view.d.ts +5 -0
  162. package/build/third-party/collection-view.d.ts.map +1 -0
  163. package/build/third-party/collection.d.ts +11 -0
  164. package/build/third-party/collection.d.ts.map +1 -0
  165. package/build/third-party/collection.js +4512 -0
  166. package/build/third-party/equation.d.ts +9 -0
  167. package/build/third-party/equation.d.ts.map +1 -0
  168. package/build/third-party/equation.js +36 -0
  169. package/build/third-party/eval-formula.d.ts +21 -0
  170. package/build/third-party/eval-formula.d.ts.map +1 -0
  171. package/build/third-party/modal.d.ts +3 -0
  172. package/build/third-party/modal.d.ts.map +1 -0
  173. package/build/third-party/modal.js +7 -0
  174. package/build/third-party/pdf.d.ts +5 -0
  175. package/build/third-party/pdf.d.ts.map +1 -0
  176. package/build/third-party/pdf.js +20 -0
  177. package/build/third-party/property.d.ts +22 -0
  178. package/build/third-party/property.d.ts.map +1 -0
  179. package/build/types.d.ts +72 -0
  180. package/build/types.d.ts.map +1 -0
  181. package/build/utils.d.ts +10 -0
  182. package/build/utils.d.ts.map +1 -0
  183. package/package.json +62 -0
  184. package/readme.md +19 -0
  185. package/src/styles.css +2786 -0
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import { EquationBlock } from '@texonom/ntypes';
3
+ export declare const Equation: React.FC<{
4
+ block: EquationBlock;
5
+ math?: string;
6
+ inline?: boolean;
7
+ className?: string;
8
+ }>;
9
+ //# sourceMappingURL=equation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"equation.d.ts","sourceRoot":"","sources":["../../src/third-party/equation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAW/C,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;IAC9B,KAAK,EAAE,aAAa,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAaA,CAAA"}
@@ -0,0 +1,36 @@
1
+ import {
2
+ cs,
3
+ useNotionContext
4
+ } from "../chunk-RGP7M4NM.js";
5
+ import {
6
+ __objRest,
7
+ __spreadValues
8
+ } from "../chunk-723T62SD.js";
9
+
10
+ // src/third-party/equation.tsx
11
+ import * as React from "react";
12
+ import Katex from "@matejmazur/react-katex";
13
+ import { getBlockTitle } from "@texonom/nutils";
14
+ var katexSettings = {
15
+ throwOnError: false,
16
+ strict: false
17
+ };
18
+ var Equation = (_a) => {
19
+ var _b = _a, { block, math, inline = false, className } = _b, rest = __objRest(_b, ["block", "math", "inline", "className"]);
20
+ const { recordMap } = useNotionContext();
21
+ math = math || getBlockTitle(block, recordMap);
22
+ if (!math)
23
+ return null;
24
+ return /* @__PURE__ */ React.createElement(
25
+ "span",
26
+ {
27
+ role: "button",
28
+ tabIndex: 0,
29
+ className: cs("notion-equation", inline ? "notion-equation-inline" : "notion-equation-block", className)
30
+ },
31
+ /* @__PURE__ */ React.createElement(Katex, __spreadValues({ math, settings: katexSettings }, rest))
32
+ );
33
+ };
34
+ export {
35
+ Equation
36
+ };
@@ -0,0 +1,21 @@
1
+ import * as types from '@texonom/ntypes';
2
+ export interface EvalFormulaContext {
3
+ properties: types.PropertyMap;
4
+ schema: types.CollectionPropertySchemaMap;
5
+ endDate?: boolean;
6
+ }
7
+ /**
8
+ * Evaluates a Notion formula expression to a result value.
9
+ *
10
+ * All built-in functions and operators are supported.
11
+ *
12
+ * NOTE: this needs a lot more testing, especially around covering all the different
13
+ * function types and coercing different property values correctly.
14
+ *
15
+ * It does work for many of our test cases, however.
16
+ *
17
+ * @param formula - Formula to evaluate.
18
+ * @param context - Collection context containing property schema and values.
19
+ */
20
+ export declare function evalFormula(formula: types.Formula, context: EvalFormulaContext): types.FormulaResult;
21
+ //# sourceMappingURL=eval-formula.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eval-formula.d.ts","sourceRoot":"","sources":["../../src/third-party/eval-formula.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAA;AAaxC,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,KAAK,CAAC,WAAW,CAAA;IAC7B,MAAM,EAAE,KAAK,CAAC,2BAA2B,CAAA;IAEzC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAoEpG"}
@@ -0,0 +1,3 @@
1
+ import Modal from 'react-modal';
2
+ export { Modal };
3
+ //# sourceMappingURL=modal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/third-party/modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,aAAa,CAAA;AAE/B,OAAO,EAAE,KAAK,EAAE,CAAA"}
@@ -0,0 +1,7 @@
1
+ import "../chunk-723T62SD.js";
2
+
3
+ // src/third-party/modal.tsx
4
+ import Modal from "react-modal";
5
+ export {
6
+ Modal
7
+ };
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export declare const Pdf: React.FC<{
3
+ file: string;
4
+ }>;
5
+ //# sourceMappingURL=pdf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdf.d.ts","sourceRoot":"","sources":["../../src/third-party/pdf.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAc1C,CAAA"}
@@ -0,0 +1,20 @@
1
+ import {
2
+ __objRest,
3
+ __spreadValues
4
+ } from "../chunk-723T62SD.js";
5
+
6
+ // src/third-party/pdf.tsx
7
+ import * as React from "react";
8
+ import { Document, Page, pdfjs } from "react-pdf";
9
+ pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/legacy/build/pdf.worker.min.js`;
10
+ var Pdf = (_a) => {
11
+ var _b = _a, { file } = _b, rest = __objRest(_b, ["file"]);
12
+ const [numPages, setNumPages] = React.useState(null);
13
+ function onDocumentLoadSuccess({ numPages: numPages2 }) {
14
+ setNumPages(numPages2);
15
+ }
16
+ return /* @__PURE__ */ React.createElement(Document, __spreadValues({ file, onLoadSuccess: onDocumentLoadSuccess }, rest), Array.from(new Array(numPages), (_, index) => /* @__PURE__ */ React.createElement(Page, { key: `page_${index + 1}`, pageNumber: index + 1 })));
17
+ };
18
+ export {
19
+ Pdf
20
+ };
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import * as types from '@texonom/ntypes';
3
+ export interface IPropertyProps {
4
+ propertyId?: string;
5
+ schema?: types.CollectionPropertySchema;
6
+ data?: types.Decoration[];
7
+ block?: types.Block;
8
+ collection?: types.Collection;
9
+ inline?: boolean;
10
+ linkToTitlePage?: boolean;
11
+ pageHeader?: boolean;
12
+ }
13
+ /**
14
+ * Renders a single value of structured Notion data according to its schema.
15
+ *
16
+ * This corresponds to rendering the content of a single cell in a table.
17
+ * Property rendering is re-used across all the different types of collection views.
18
+ */
19
+ export declare const Property: React.FC<IPropertyProps>;
20
+ export declare const PropertyImpl: React.FC<IPropertyProps>;
21
+ export declare const PropertyImplMemo: React.NamedExoticComponent<IPropertyProps>;
22
+ //# sourceMappingURL=property.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property.d.ts","sourceRoot":"","sources":["../../src/third-party/property.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAA;AAaxC,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,KAAK,CAAC,wBAAwB,CAAA;IACvC,IAAI,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,CAAA;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,CAAA;IACnB,UAAU,CAAC,EAAE,KAAK,CAAC,UAAU,CAAA;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAK7C,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAoVjD,CAAA;AAED,eAAO,MAAM,gBAAgB,4CAA2B,CAAA"}
@@ -0,0 +1,72 @@
1
+ import * as React from 'react';
2
+ import * as types from '@texonom/ntypes';
3
+ export type MapPageUrlFn = (pageId: string, recordMap?: types.ExtendedRecordMap | undefined) => string;
4
+ export type MapImageUrlFn = (url: string, block: types.Block) => string;
5
+ export type SearchNotionFn = (params: types.SearchParams) => Promise<types.SearchResults>;
6
+ export type ComponentOverrideFn = (props: any, defaultValueFn: () => React.ReactNode) => any;
7
+ export interface NotionComponents {
8
+ Image: any;
9
+ Link: any;
10
+ PageLink: any;
11
+ Checkbox: React.FC<{
12
+ isChecked: boolean;
13
+ blockId: string;
14
+ }>;
15
+ Code: any;
16
+ Equation: any;
17
+ Callout?: any;
18
+ Collection: any;
19
+ Property?: any;
20
+ propertyTextValue: ComponentOverrideFn;
21
+ propertySelectValue: ComponentOverrideFn;
22
+ propertyRelationValue: ComponentOverrideFn;
23
+ propertyFormulaValue: ComponentOverrideFn;
24
+ propertyTitleValue: ComponentOverrideFn;
25
+ propertyPersonValue: ComponentOverrideFn;
26
+ propertyFileValue: ComponentOverrideFn;
27
+ propertyCheckboxValue: ComponentOverrideFn;
28
+ propertyUrlValue: ComponentOverrideFn;
29
+ propertyEmailValue: ComponentOverrideFn;
30
+ propertyPhoneNumberValue: ComponentOverrideFn;
31
+ propertyNumberValue: ComponentOverrideFn;
32
+ propertyLastEditedTimeValue: ComponentOverrideFn;
33
+ propertyCreatedTimeValue: ComponentOverrideFn;
34
+ propertyDateValue: ComponentOverrideFn;
35
+ Pdf: any;
36
+ Tweet: any;
37
+ Modal: any;
38
+ Embed: any;
39
+ Header: any;
40
+ nextImage?: any;
41
+ nextLink?: any;
42
+ }
43
+ export interface CollectionViewProps {
44
+ collection: types.Collection;
45
+ collectionView: types.CollectionView;
46
+ collectionData: types.CollectionQueryResult;
47
+ padding?: number;
48
+ width?: number;
49
+ }
50
+ export interface CollectionCardProps {
51
+ collection: types.Collection;
52
+ block: types.PageBlock;
53
+ cover: types.CollectionCardCover;
54
+ coverSize: types.CollectionCardCoverSize;
55
+ coverAspect: types.CollectionCardCoverAspect;
56
+ properties?: Array<{
57
+ property: types.PropertyID;
58
+ visible: boolean;
59
+ }>;
60
+ className?: string;
61
+ }
62
+ export interface CollectionGroupProps {
63
+ collection: types.Collection;
64
+ collectionViewComponent: React.ElementType;
65
+ collectionGroup: any;
66
+ hidden: boolean;
67
+ schema: any;
68
+ value: any;
69
+ summaryProps: any;
70
+ detailsProps: any;
71
+ }
72
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAA;AAExC,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,CAAC,iBAAiB,G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AClB"}
@@ -0,0 +1,10 @@
1
+ import { BlockMap } from '@texonom/ntypes';
2
+ export { isUrl, formatDate, formatNotionDateTime } from '@texonom/nutils';
3
+ export * from './map-image-url';
4
+ export * from './map-page-url';
5
+ export declare const cs: (...classes: Array<string | undefined | false>) => string;
6
+ export declare const getListNumber: (blockId: string, blockMap: BlockMap) => number;
7
+ export declare const getHashFragmentValue: (url: string) => string;
8
+ export declare const isBrowser: boolean;
9
+ export declare const getYoutubeId: (url: string) => string | null;
10
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE1C,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACzE,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAE9B,eAAO,MAAM,EAAE,eAAgB,MAAM,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC,WAAuC,CAAA;AA8BvG,eAAO,MAAM,aAAa,YAAa,MAAM,+BAO5C,CAAA;AAED,eAAO,MAAM,oBAAoB,QAAS,MAAM,WAE/C,CAAA;AAED,eAAO,MAAM,SAAS,SAAgC,CAAA;AAUtD,eAAO,MAAM,YAAY,QAAS,MAAM,KAAG,MAAM,GAAG,IAcnD,CAAA"}
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@texonom/nreact",
3
+ "version": "1.1.0",
4
+ "type": "module",
5
+ "description": "Fast and accurate React renderer for Notion.",
6
+ "repository": "texonom/notion",
7
+ "author": "Alan Jo <sungle3737@gmail.com>",
8
+ "license": "MIT",
9
+ "main": "./build/index.js",
10
+ "module": "./build/index.js",
11
+ "types": "./build/index.d.ts",
12
+ "sideEffects": false,
13
+ "files": [
14
+ "build",
15
+ "src/styles.css"
16
+ ],
17
+ "engines": {
18
+ "node": ">=v12.22.12"
19
+ },
20
+ "dependencies": {
21
+ "@fisch0920/medium-zoom": "^1.0.7",
22
+ "@matejmazur/react-katex": "^3.1.3",
23
+ "katex": "^0.16.7",
24
+ "prismjs": "^1.29.0",
25
+ "react-fast-compare": "^3.2.1",
26
+ "react-hotkeys-hook": "^3.4.7",
27
+ "react-image": "^4.1.0",
28
+ "react-modal": "^3.16.1",
29
+ "react-pdf": "^5.7.2",
30
+ "react-use": "^17.4.0",
31
+ "@texonom/ntypes": "^1.1.0",
32
+ "@texonom/nutils": "^1.1.0"
33
+ },
34
+ "devDependencies": {
35
+ "@types/lodash.throttle": "^4.1.7",
36
+ "@types/node": "^16.18.28",
37
+ "@types/react": "^17.0.59",
38
+ "clipboard-copy": "^4.0.1",
39
+ "date-fns": "^2.30.0",
40
+ "format-number": "^3.0.0",
41
+ "lodash.throttle": "^4.1.1",
42
+ "react": "^17.0.2",
43
+ "react-dom": "^17.0.2"
44
+ },
45
+ "peerDependencies": {
46
+ "react": ">=16",
47
+ "react-dom": ">=16"
48
+ },
49
+ "standard-version": {
50
+ "skip": {
51
+ "commit": true,
52
+ "tag": true
53
+ }
54
+ },
55
+ "scripts": {
56
+ "build": "tsc && tsup",
57
+ "watch": "tsup --watch --silent --onSuccess 'echo build successful'",
58
+ "prerelease": "standard-version --skip.changelog --prerelease",
59
+ "release": "standard-version --release-as",
60
+ "pu": "pnpm publish"
61
+ }
62
+ }
package/readme.md ADDED
@@ -0,0 +1,19 @@
1
+ <p align="center">
2
+ <img alt="React Notion X" src="https://raw.githubusercontent.com/texonom/notion/master/media/notion-ts.png" width="689">
3
+ </p>
4
+
5
+ # React Notion X
6
+
7
+ > Fast and accurate React renderer for Notion.
8
+
9
+ [![NPM](https://img.shields.io/npm/v/nreact.svg)](https://www.npmjs.com/package/nreact) [![Build Status](https://github.com/texonom/notion/actions/workflows/test.yml/badge.svg)](https://github.com/texonom/notion/actions/workflows/test.yml) [![Prettier Code Formatting](https://img.shields.io/badge/code_style-prettier-brightgreen.svg)](https://prettier.io)
10
+
11
+ ## Docs
12
+
13
+ See the [full docs](https://github.com/texonom/notion).
14
+
15
+ ## License
16
+
17
+ MIT © [Travis Fischer](https://transitivebullsh.it)
18
+
19
+ Support my OSS work by <a href="https://twitter.com/transitive_bs">following me on twitter <img src="https://storage.googleapis.com/saasify-assets/twitter-logo.svg" alt="twitter" height="24px" align="center"></a>