@pyreon/document-primitives 0.11.5 → 0.11.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.
@@ -1,19 +1,19 @@
1
- import { Element } from "@pyreon/elements"
2
- import rocketstyle from "@pyreon/rocketstyle"
1
+ import { Element } from '@pyreon/elements'
2
+ import rocketstyle from '@pyreon/rocketstyle'
3
3
 
4
- const DocPage = rocketstyle()({ name: "DocPage", component: Element })
4
+ const DocPage = rocketstyle()({ name: 'DocPage', component: Element })
5
5
  .theme({
6
- backgroundColor: "#ffffff",
7
- padding: "25mm",
6
+ backgroundColor: '#ffffff',
7
+ padding: '25mm',
8
8
  })
9
- .statics({ _documentType: "page" as const })
9
+ .statics({ _documentType: 'page' as const })
10
10
  .attrs<{
11
11
  size?: string
12
12
  orientation?: string
13
13
  tag: string
14
14
  _documentProps: Record<string, unknown>
15
15
  }>((props) => ({
16
- tag: "div",
16
+ tag: 'div',
17
17
  _documentProps: {
18
18
  ...(props.size ? { size: props.size } : {}),
19
19
  ...(props.orientation ? { orientation: props.orientation } : {}),
@@ -1,10 +1,10 @@
1
- import { Element } from "@pyreon/elements"
2
- import rocketstyle from "@pyreon/rocketstyle"
1
+ import { Element } from '@pyreon/elements'
2
+ import rocketstyle from '@pyreon/rocketstyle'
3
3
 
4
- const DocPageBreak = rocketstyle()({ name: "DocPageBreak", component: Element })
5
- .statics({ _documentType: "page-break" as const })
4
+ const DocPageBreak = rocketstyle()({ name: 'DocPageBreak', component: Element })
5
+ .statics({ _documentType: 'page-break' as const })
6
6
  .attrs<{ tag: string; _documentProps: Record<string, unknown> }>((_props) => ({
7
- tag: "div",
7
+ tag: 'div',
8
8
  _documentProps: {},
9
9
  }))
10
10
 
@@ -1,17 +1,17 @@
1
- import { Element } from "@pyreon/elements"
2
- import rocketstyle from "@pyreon/rocketstyle"
1
+ import { Element } from '@pyreon/elements'
2
+ import rocketstyle from '@pyreon/rocketstyle'
3
3
 
4
- const DocQuote = rocketstyle()({ name: "DocQuote", component: Element })
4
+ const DocQuote = rocketstyle()({ name: 'DocQuote', component: Element })
5
5
  .theme({
6
- borderColor: "#4f46e5",
7
- padding: "8px 16px",
8
- fontStyle: "italic",
9
- color: "#666666",
6
+ borderColor: '#4f46e5',
7
+ padding: '8px 16px',
8
+ fontStyle: 'italic',
9
+ color: '#666666',
10
10
  })
11
- .statics({ _documentType: "quote" as const })
11
+ .statics({ _documentType: 'quote' as const })
12
12
  .attrs<{ borderColor?: string; tag: string; _documentProps: Record<string, unknown> }>(
13
13
  (props) => ({
14
- tag: "blockquote",
14
+ tag: 'blockquote',
15
15
  _documentProps: props.borderColor ? { borderColor: props.borderColor } : {},
16
16
  }),
17
17
  )
@@ -1,13 +1,13 @@
1
- import { Element } from "@pyreon/elements"
2
- import rocketstyle from "@pyreon/rocketstyle"
1
+ import { Element } from '@pyreon/elements'
2
+ import rocketstyle from '@pyreon/rocketstyle'
3
3
 
4
- const DocRow = rocketstyle()({ name: "DocRow", component: Element })
4
+ const DocRow = rocketstyle()({ name: 'DocRow', component: Element })
5
5
  .theme({
6
- direction: "row",
6
+ direction: 'row',
7
7
  })
8
- .statics({ _documentType: "row" as const })
8
+ .statics({ _documentType: 'row' as const })
9
9
  .attrs<{ tag: string; _documentProps: Record<string, unknown> }>((_props) => ({
10
- tag: "div",
10
+ tag: 'div',
11
11
  _documentProps: {},
12
12
  }))
13
13
 
@@ -1,23 +1,23 @@
1
- import { Element } from "@pyreon/elements"
2
- import rocketstyle from "@pyreon/rocketstyle"
1
+ import { Element } from '@pyreon/elements'
2
+ import rocketstyle from '@pyreon/rocketstyle'
3
3
 
4
4
  const DocSection = rocketstyle({
5
5
  dimensions: {
6
- directions: "direction",
6
+ directions: 'direction',
7
7
  },
8
8
  useBooleans: false,
9
- })({ name: "DocSection", component: Element })
9
+ })({ name: 'DocSection', component: Element })
10
10
  .theme({
11
11
  padding: 0,
12
12
  })
13
13
  .directions({
14
14
  column: {},
15
- row: { direction: "row" },
15
+ row: { direction: 'row' },
16
16
  })
17
- .statics({ _documentType: "section" as const })
17
+ .statics({ _documentType: 'section' as const })
18
18
  .attrs<{ direction?: string; tag: string; _documentProps: { direction: string } }>((props) => ({
19
- tag: "div",
20
- _documentProps: { direction: props.direction ?? "column" },
19
+ tag: 'div',
20
+ _documentProps: { direction: props.direction ?? 'column' },
21
21
  }))
22
22
 
23
23
  export default DocSection
@@ -1,10 +1,10 @@
1
- import { Element } from "@pyreon/elements"
2
- import rocketstyle from "@pyreon/rocketstyle"
1
+ import { Element } from '@pyreon/elements'
2
+ import rocketstyle from '@pyreon/rocketstyle'
3
3
 
4
- const DocSpacer = rocketstyle()({ name: "DocSpacer", component: Element })
5
- .statics({ _documentType: "spacer" as const })
4
+ const DocSpacer = rocketstyle()({ name: 'DocSpacer', component: Element })
5
+ .statics({ _documentType: 'spacer' as const })
6
6
  .attrs<{ height?: number; tag: string; _documentProps: { height: number } }>((props) => ({
7
- tag: "div",
7
+ tag: 'div',
8
8
  _documentProps: { height: props.height ?? 16 },
9
9
  }))
10
10
 
@@ -1,17 +1,17 @@
1
- import { Element } from "@pyreon/elements"
2
- import rocketstyle from "@pyreon/rocketstyle"
1
+ import { Element } from '@pyreon/elements'
2
+ import rocketstyle from '@pyreon/rocketstyle'
3
3
 
4
4
  const DocTable = rocketstyle({
5
5
  dimensions: {
6
- variants: "variant",
6
+ variants: 'variant',
7
7
  },
8
8
  useBooleans: true,
9
- })({ name: "DocTable", component: Element })
9
+ })({ name: 'DocTable', component: Element })
10
10
  .theme({
11
11
  fontSize: 14,
12
- borderColor: "#dddddd",
12
+ borderColor: '#dddddd',
13
13
  })
14
- .statics({ _documentType: "table" as const })
14
+ .statics({ _documentType: 'table' as const })
15
15
  .attrs<{
16
16
  columns?: unknown[]
17
17
  rows?: unknown[]
@@ -22,7 +22,7 @@ const DocTable = rocketstyle({
22
22
  tag: string
23
23
  _documentProps: Record<string, unknown>
24
24
  }>((props) => ({
25
- tag: "table",
25
+ tag: 'table',
26
26
  _documentProps: {
27
27
  columns: props.columns ?? [],
28
28
  rows: props.rows ?? [],
@@ -1,34 +1,34 @@
1
- import { Text } from "@pyreon/elements"
2
- import rocketstyle from "@pyreon/rocketstyle"
1
+ import { Text } from '@pyreon/elements'
2
+ import rocketstyle from '@pyreon/rocketstyle'
3
3
 
4
4
  const DocText = rocketstyle({
5
5
  dimensions: {
6
- variants: "variant",
7
- weights: "weight",
6
+ variants: 'variant',
7
+ weights: 'weight',
8
8
  },
9
9
  useBooleans: true,
10
- })({ name: "DocText", component: Text })
10
+ })({ name: 'DocText', component: Text })
11
11
  .theme({
12
- color: "#333333",
12
+ color: '#333333',
13
13
  lineHeight: 1.5,
14
14
  marginBottom: 8,
15
15
  })
16
16
  .variants({
17
17
  body: { fontSize: 14 },
18
- caption: { fontSize: 12, color: "#666666" },
19
- label: { fontSize: 11, fontWeight: "bold" },
18
+ caption: { fontSize: 12, color: '#666666' },
19
+ label: { fontSize: 11, fontWeight: 'bold' },
20
20
  })
21
21
  .weights({
22
- normal: { fontWeight: "normal" },
23
- bold: { fontWeight: "bold" },
22
+ normal: { fontWeight: 'normal' },
23
+ bold: { fontWeight: 'bold' },
24
24
  })
25
- .statics({ _documentType: "text" as const })
25
+ .statics({ _documentType: 'text' as const })
26
26
  // .attrs(
27
27
  // (props: any) =>
28
28
  // ({
29
29
  // tag: "p",
30
30
  .attrs<{ tag: string; _documentProps: Record<string, unknown> }>((_props) => ({
31
- tag: "p",
31
+ tag: 'p',
32
32
  _documentProps: {},
33
33
  }))
34
34
 
package/src/theme.ts CHANGED
@@ -1,18 +1,18 @@
1
1
  export const documentTheme = {
2
2
  colors: {
3
- primary: "#4f46e5",
4
- text: "#333333",
5
- textSecondary: "#666666",
6
- background: "#ffffff",
7
- border: "#dddddd",
8
- headerBg: "#1a1a2e",
9
- headerText: "#ffffff",
10
- stripedRow: "#f9f9f9",
3
+ primary: '#4f46e5',
4
+ text: '#333333',
5
+ textSecondary: '#666666',
6
+ background: '#ffffff',
7
+ border: '#dddddd',
8
+ headerBg: '#1a1a2e',
9
+ headerText: '#ffffff',
10
+ stripedRow: '#f9f9f9',
11
11
  },
12
12
  fonts: {
13
- heading: "system-ui, -apple-system, sans-serif",
14
- body: "system-ui, -apple-system, sans-serif",
15
- mono: "ui-monospace, monospace",
13
+ heading: 'system-ui, -apple-system, sans-serif',
14
+ body: 'system-ui, -apple-system, sans-serif',
15
+ mono: 'ui-monospace, monospace',
16
16
  },
17
17
  sizes: {
18
18
  h1: 32,
@@ -1,11 +1,11 @@
1
- import type { DocNode, ExtractOptions } from "@pyreon/connector-document"
2
- import { extractDocumentTree } from "@pyreon/connector-document"
1
+ import type { DocNode, ExtractOptions } from '@pyreon/connector-document'
2
+ import { extractDocumentTree } from '@pyreon/connector-document'
3
3
 
4
4
  export interface DocumentExportOptions extends ExtractOptions {
5
5
  /** Theme object to provide during extraction. */
6
6
  theme?: Record<string, unknown>
7
7
  /** Mode: 'light' or 'dark'. */
8
- mode?: "light" | "dark"
8
+ mode?: 'light' | 'dark'
9
9
  }
10
10
 
11
11
  export interface DocumentExport {