@flamingo-stack/openframe-frontend-core 0.0.612-snapshot.20260909131030 → 0.0.612
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.
- package/dist/{chunk-JHFYWBQL.js → chunk-2ARMWGMN.js} +2 -2
- package/dist/{chunk-JEM7QP64.js → chunk-2LSVHTRX.js} +2 -2
- package/dist/{chunk-YDCFOBF4.cjs → chunk-2XG3XBWA.cjs} +15 -15
- package/dist/{chunk-YDCFOBF4.cjs.map → chunk-2XG3XBWA.cjs.map} +1 -1
- package/dist/{chunk-5OAU5YAO.cjs → chunk-2YQMBF2V.cjs} +70 -70
- package/dist/{chunk-5OAU5YAO.cjs.map → chunk-2YQMBF2V.cjs.map} +1 -1
- package/dist/{chunk-OGPFEPYR.cjs → chunk-3GICERNL.cjs} +4 -4
- package/dist/{chunk-OGPFEPYR.cjs.map → chunk-3GICERNL.cjs.map} +1 -1
- package/dist/{chunk-ABY7UTVQ.js → chunk-44XMSKIY.js} +3 -3
- package/dist/{chunk-QXLRO7ZT.cjs → chunk-4QD4JCG3.cjs} +33 -33
- package/dist/{chunk-QXLRO7ZT.cjs.map → chunk-4QD4JCG3.cjs.map} +1 -1
- package/dist/{chunk-BMM5VW4Y.cjs → chunk-B4G3TQOP.cjs} +22 -22
- package/dist/{chunk-BMM5VW4Y.cjs.map → chunk-B4G3TQOP.cjs.map} +1 -1
- package/dist/{chunk-276EROVV.cjs → chunk-BG7TRGKP.cjs} +22 -22
- package/dist/{chunk-276EROVV.cjs.map → chunk-BG7TRGKP.cjs.map} +1 -1
- package/dist/{chunk-M7ZHKZMT.js → chunk-CFFY6TT3.js} +2 -2
- package/dist/{chunk-MR22RVGZ.js → chunk-DZMEAV47.js} +8 -50
- package/dist/{chunk-MR22RVGZ.js.map → chunk-DZMEAV47.js.map} +1 -1
- package/dist/{chunk-HMOBSK67.js → chunk-EJTSKGAA.js} +5 -5
- package/dist/{chunk-667WOI4D.js → chunk-F2C2U7CP.js} +2 -16
- package/dist/chunk-F2C2U7CP.js.map +1 -0
- package/dist/{chunk-Y2SCYKEX.js → chunk-F7Y55UK5.js} +5 -5
- package/dist/{chunk-EVBLEWLF.cjs → chunk-FXP2J34I.cjs} +25 -25
- package/dist/{chunk-EVBLEWLF.cjs.map → chunk-FXP2J34I.cjs.map} +1 -1
- package/dist/{chunk-ZQEG56IM.js → chunk-HBG6576N.js} +3 -3
- package/dist/{chunk-DONH7AHG.js → chunk-IDVXWDYF.js} +3 -3
- package/dist/{chunk-NFBTBZXA.cjs → chunk-J2RTUYK7.cjs} +43 -43
- package/dist/{chunk-NFBTBZXA.cjs.map → chunk-J2RTUYK7.cjs.map} +1 -1
- package/dist/{chunk-OAXOGKFD.cjs → chunk-LEKBOXVT.cjs} +5 -5
- package/dist/{chunk-OAXOGKFD.cjs.map → chunk-LEKBOXVT.cjs.map} +1 -1
- package/dist/{chunk-W35UYD7W.js → chunk-LTYDKO22.js} +3 -3
- package/dist/{chunk-5ZQWHR5K.cjs → chunk-M2QZI32A.cjs} +10 -10
- package/dist/{chunk-5ZQWHR5K.cjs.map → chunk-M2QZI32A.cjs.map} +1 -1
- package/dist/{chunk-4H3JGIGZ.cjs → chunk-NTUOX5QC.cjs} +3 -3
- package/dist/{chunk-4H3JGIGZ.cjs.map → chunk-NTUOX5QC.cjs.map} +1 -1
- package/dist/{chunk-36GD5KOC.cjs → chunk-PAC2VMWE.cjs} +9 -9
- package/dist/{chunk-36GD5KOC.cjs.map → chunk-PAC2VMWE.cjs.map} +1 -1
- package/dist/{chunk-RBA263EG.cjs → chunk-QMUFGSVF.cjs} +165 -207
- package/dist/chunk-QMUFGSVF.cjs.map +1 -0
- package/dist/{chunk-OLIEBXIS.js → chunk-TKRHBU7W.js} +4 -4
- package/dist/{chunk-4KMVXQJW.js → chunk-UYT24TGS.js} +5 -5
- package/dist/{chunk-JMSB5AUS.js → chunk-WYRBZJTT.js} +6 -6
- package/dist/{chunk-C6UMRTEV.js → chunk-X2YX5HN5.js} +3 -3
- package/dist/{chunk-7UI5DJSF.js → chunk-X4LTHAY5.js} +2 -2
- package/dist/{chunk-GWVH3RFQ.cjs → chunk-XSDNHDSX.cjs} +10 -10
- package/dist/{chunk-GWVH3RFQ.cjs.map → chunk-XSDNHDSX.cjs.map} +1 -1
- package/dist/{chunk-DESNTW3L.cjs → chunk-Y775VLFS.cjs} +3 -3
- package/dist/{chunk-DESNTW3L.cjs.map → chunk-Y775VLFS.cjs.map} +1 -1
- package/dist/{chunk-2OREW4SL.cjs → chunk-YXTAV2E3.cjs} +2 -16
- package/dist/chunk-YXTAV2E3.cjs.map +1 -0
- package/dist/components/case-studies/index.cjs +9 -9
- package/dist/components/case-studies/index.js +3 -3
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/contact/index.cjs +4 -4
- package/dist/components/contact/index.js +3 -3
- package/dist/components/docs/index.cjs +7 -7
- package/dist/components/docs/index.js +6 -6
- package/dist/components/embeds/index.cjs +4 -4
- package/dist/components/embeds/index.js +3 -3
- package/dist/components/faq/index.cjs +4 -4
- package/dist/components/faq/index.js +3 -3
- package/dist/components/features/index.cjs +3 -3
- package/dist/components/features/index.js +2 -2
- package/dist/components/help-center-pages/index.cjs +23 -23
- package/dist/components/help-center-pages/index.js +14 -14
- package/dist/components/index.cjs +38 -38
- package/dist/components/index.js +13 -13
- package/dist/components/meeting-scheduler/index.cjs +24 -24
- package/dist/components/meeting-scheduler/index.js +2 -2
- package/dist/components/navigation/index.cjs +6 -6
- package/dist/components/navigation/index.js +5 -5
- package/dist/components/onboarding-guides/index.cjs +6 -6
- package/dist/components/onboarding-guides/index.js +5 -5
- package/dist/components/tickets/index.cjs +7 -7
- package/dist/components/tickets/index.js +6 -6
- package/dist/components/ui/index.cjs +3 -3
- package/dist/components/ui/index.js +2 -2
- package/dist/components/ui/markdown/base-components.d.ts.map +1 -1
- package/dist/components/ui/markdown-editor.d.ts.map +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +6 -6
- package/package.json +1 -1
- package/src/components/features/notifications/notification-drawer.tsx +2 -2
- package/src/components/ui/__tests__/__snapshots__/markdown-parity.test.tsx.snap +3 -3
- package/src/components/ui/markdown/base-components.tsx +4 -16
- package/src/components/ui/markdown-editor.tsx +4 -46
- package/dist/chunk-2OREW4SL.cjs.map +0 -1
- package/dist/chunk-667WOI4D.js.map +0 -1
- package/dist/chunk-RBA263EG.cjs.map +0 -1
- package/src/stories/MarkdownEditor.stories.tsx +0 -145
- /package/dist/{chunk-JHFYWBQL.js.map → chunk-2ARMWGMN.js.map} +0 -0
- /package/dist/{chunk-JEM7QP64.js.map → chunk-2LSVHTRX.js.map} +0 -0
- /package/dist/{chunk-ABY7UTVQ.js.map → chunk-44XMSKIY.js.map} +0 -0
- /package/dist/{chunk-M7ZHKZMT.js.map → chunk-CFFY6TT3.js.map} +0 -0
- /package/dist/{chunk-HMOBSK67.js.map → chunk-EJTSKGAA.js.map} +0 -0
- /package/dist/{chunk-Y2SCYKEX.js.map → chunk-F7Y55UK5.js.map} +0 -0
- /package/dist/{chunk-ZQEG56IM.js.map → chunk-HBG6576N.js.map} +0 -0
- /package/dist/{chunk-DONH7AHG.js.map → chunk-IDVXWDYF.js.map} +0 -0
- /package/dist/{chunk-W35UYD7W.js.map → chunk-LTYDKO22.js.map} +0 -0
- /package/dist/{chunk-OLIEBXIS.js.map → chunk-TKRHBU7W.js.map} +0 -0
- /package/dist/{chunk-4KMVXQJW.js.map → chunk-UYT24TGS.js.map} +0 -0
- /package/dist/{chunk-JMSB5AUS.js.map → chunk-WYRBZJTT.js.map} +0 -0
- /package/dist/{chunk-C6UMRTEV.js.map → chunk-X2YX5HN5.js.map} +0 -0
- /package/dist/{chunk-7UI5DJSF.js.map → chunk-X4LTHAY5.js.map} +0 -0
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/nextjs-vite';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { MarkdownEditor } from '../components/ui/markdown-editor';
|
|
4
|
-
import { SimpleMarkdownRenderer } from '../components/ui/markdown/simple-markdown-renderer';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* `MarkdownEditor` is controlled (`value` + `onChange`), so the stories hold the
|
|
8
|
-
* markdown here. `value`/`onChange` are hidden from the Controls table for the
|
|
9
|
-
* same reason: they are owned by this wrapper, and leaving them editable would
|
|
10
|
-
* offer a control that changes nothing.
|
|
11
|
-
*/
|
|
12
|
-
function ControlledEditor({
|
|
13
|
-
initialValue = '',
|
|
14
|
-
...props
|
|
15
|
-
}: { initialValue?: string } & Omit<React.ComponentProps<typeof MarkdownEditor>, 'value' | 'onChange'>) {
|
|
16
|
-
const [value, setValue] = useState(initialValue);
|
|
17
|
-
return <MarkdownEditor {...props} value={value} onChange={setValue} />;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* The preview the Knowledge Base form passes: the vendor's own renderer is replaced
|
|
22
|
-
* by ours, so the pane shows what the article will actually look like. Copied from
|
|
23
|
-
* `article-form-fields.tsx` wrapper and all — the wrapper class is load-bearing, the
|
|
24
|
-
* editor's stylesheet excludes `.custom-preview-wrapper *` from its colour override.
|
|
25
|
-
*/
|
|
26
|
-
const renderPreview = (source: string) => (
|
|
27
|
-
<div className="custom-preview-wrapper" style={{ height: '100%', overflow: 'auto' }}>
|
|
28
|
-
<SimpleMarkdownRenderer content={source} />
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
/** Stand-in for the article-image upload the Knowledge Base form passes. */
|
|
33
|
-
const uploadStub = (file: File) =>
|
|
34
|
-
new Promise<string>(resolve => setTimeout(() => resolve(`https://example.com/uploads/${file.name}`), 600));
|
|
35
|
-
|
|
36
|
-
const SAMPLE = `## Restarting the print spooler
|
|
37
|
-
|
|
38
|
-
Run the following on the affected endpoint:
|
|
39
|
-
|
|
40
|
-
\`\`\`powershell
|
|
41
|
-
Restart-Service -Name Spooler -Force
|
|
42
|
-
\`\`\`
|
|
43
|
-
|
|
44
|
-
| Step | Command | Elevated |
|
|
45
|
-
| --- | --- | --- |
|
|
46
|
-
| Stop | \`Stop-Service Spooler\` | yes |
|
|
47
|
-
| Clear | \`Remove-Item C:\\Windows\\System32\\spool\\PRINTERS\\*\` | yes |
|
|
48
|
-
| Start | \`Start-Service Spooler\` | yes |
|
|
49
|
-
|
|
50
|
-
> The queue is cleared for every user on the machine, not just the caller.
|
|
51
|
-
`;
|
|
52
|
-
|
|
53
|
-
const meta = {
|
|
54
|
-
title: 'UI/MarkdownEditor',
|
|
55
|
-
component: MarkdownEditor,
|
|
56
|
-
parameters: {
|
|
57
|
-
layout: 'padded',
|
|
58
|
-
docs: {
|
|
59
|
-
description: {
|
|
60
|
-
component:
|
|
61
|
-
'Split markdown editor — toolbar, source pane and live preview. Wraps `@uiw/react-md-editor` and restyles it onto ODS tokens through an injected stylesheet, so its framing (border, radius, the toolbar/source seam) is owned here rather than by the vendor. Its one consumer is the Knowledge Base article form in `openframe-oss-frontend`, which is what `Default` reproduces.',
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
tags: ['autodocs'],
|
|
66
|
-
argTypes: {
|
|
67
|
-
// Owned by `ControlledEditor` — see its note.
|
|
68
|
-
value: { table: { disable: true } },
|
|
69
|
-
onChange: { table: { disable: true } },
|
|
70
|
-
onUploadFile: { table: { disable: true } },
|
|
71
|
-
onFileUploaded: { table: { disable: true } },
|
|
72
|
-
renderPreview: { table: { disable: true } },
|
|
73
|
-
placeholder: { control: 'text', description: 'Placeholder shown while the editor is empty' },
|
|
74
|
-
disabled: { control: 'boolean', description: 'Disabled state' },
|
|
75
|
-
height: {
|
|
76
|
-
control: 'number',
|
|
77
|
-
description: 'Initial height in pixels (default 600). Resizable by the drag handle.',
|
|
78
|
-
},
|
|
79
|
-
minHeight: { control: 'number', description: 'Lower bound for the drag handle (default 100)' },
|
|
80
|
-
},
|
|
81
|
-
decorators: [
|
|
82
|
-
Story => (
|
|
83
|
-
<div style={{ padding: '2rem', backgroundColor: 'var(--ods-bg)' }}>
|
|
84
|
-
<Story />
|
|
85
|
-
</div>
|
|
86
|
-
),
|
|
87
|
-
],
|
|
88
|
-
} satisfies Meta<typeof MarkdownEditor>;
|
|
89
|
-
|
|
90
|
-
export default meta;
|
|
91
|
-
type Story = StoryObj<typeof meta>;
|
|
92
|
-
|
|
93
|
-
const base = { value: '', onChange: () => {} };
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* The Knowledge Base article form's own configuration: 400px tall and an upload
|
|
97
|
-
* handler, which is what puts the upload command at the end of the toolbar.
|
|
98
|
-
*/
|
|
99
|
-
export const Default: Story = {
|
|
100
|
-
args: { ...base, placeholder: 'Write the article content...', height: 400 },
|
|
101
|
-
render: args => <ControlledEditor {...args} onUploadFile={uploadStub} renderPreview={renderPreview} />,
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* With content, exercising the preview pane: headings, a fenced code block, a
|
|
106
|
-
* GFM table and a blockquote.
|
|
107
|
-
*/
|
|
108
|
-
export const WithContent: Story = {
|
|
109
|
-
args: { ...base, height: 400 },
|
|
110
|
-
render: args => (
|
|
111
|
-
<ControlledEditor {...args} initialValue={SAMPLE} onUploadFile={uploadStub} renderPreview={renderPreview} />
|
|
112
|
-
),
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Without an upload handler the component hides the upload command, leaving a
|
|
117
|
-
* toolbar one button shorter. Documented here because it is easy to reach by
|
|
118
|
-
* accident — a consumer that forgets the prop gets this silently.
|
|
119
|
-
*/
|
|
120
|
-
export const WithoutUpload: Story = {
|
|
121
|
-
args: { ...base, placeholder: 'No upload handler passed...', height: 400 },
|
|
122
|
-
render: args => <ControlledEditor {...args} />,
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Disabled — the toolbar stays visible but nothing is editable.
|
|
127
|
-
*/
|
|
128
|
-
export const Disabled: Story = {
|
|
129
|
-
args: { ...base, height: 300, disabled: true },
|
|
130
|
-
render: args => (
|
|
131
|
-
<ControlledEditor {...args} initialValue={SAMPLE} onUploadFile={uploadStub} renderPreview={renderPreview} />
|
|
132
|
-
),
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Short editor — the frame, the toolbar seam and the resize handle at the
|
|
137
|
-
* smallest size the component is used at. Note the toolbar's title dropdown is
|
|
138
|
-
* taller than this body, which is why the frame must not clip its children.
|
|
139
|
-
*/
|
|
140
|
-
export const Compact: Story = {
|
|
141
|
-
args: { ...base, height: 200, minHeight: 120 },
|
|
142
|
-
render: args => (
|
|
143
|
-
<ControlledEditor {...args} initialValue="Short note." onUploadFile={uploadStub} renderPreview={renderPreview} />
|
|
144
|
-
),
|
|
145
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|