@revealui/core 0.13.0 → 0.14.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.
- package/README.md +3 -2
- package/dist/client/admin/components/AdminDashboard.d.ts +8 -1
- package/dist/client/admin/components/AdminDashboard.d.ts.map +1 -1
- package/dist/client/admin/components/AdminDashboard.js +11 -10
- package/dist/client/admin/components/CollectionList.d.ts.map +1 -1
- package/dist/client/admin/components/CollectionList.js +4 -6
- package/dist/client/admin/components/DocumentForm.d.ts.map +1 -1
- package/dist/client/admin/components/DocumentForm.js +26 -26
- package/dist/client/admin/components/GlobalForm.d.ts.map +1 -1
- package/dist/client/admin/components/GlobalForm.js +10 -9
- package/dist/client/admin/page.d.ts.map +1 -1
- package/dist/client/admin/page.js +2 -1
- package/dist/client/richtext/components/ImageNodeComponent.d.ts.map +1 -1
- package/dist/client/richtext/components/ImageNodeComponent.js +3 -22
- package/dist/client/richtext/components/ImageUploadButton.d.ts.map +1 -1
- package/dist/client/richtext/components/ImageUploadButton.js +2 -4
- package/dist/client/richtext/plugins/FloatingToolbarPlugin.d.ts.map +1 -1
- package/dist/client/richtext/plugins/FloatingToolbarPlugin.js +3 -2
- package/dist/client/richtext/plugins/ToolbarPlugin.d.ts.map +1 -1
- package/dist/client/richtext/plugins/ToolbarPlugin.js +3 -2
- package/dist/client/ui/index.d.ts.map +1 -1
- package/dist/client/ui/index.js +10 -6
- package/dist/cogs-breaker.d.ts +27 -0
- package/dist/cogs-breaker.d.ts.map +1 -0
- package/dist/cogs-breaker.js +29 -0
- package/dist/error-handling/error-boundary.d.ts.map +1 -1
- package/dist/error-handling/error-boundary.js +2 -9
- package/dist/error-handling/fallback-components.d.ts.map +1 -1
- package/dist/error-handling/fallback-components.js +9 -86
- package/dist/instance/logger.d.ts +2 -1
- package/dist/instance/logger.d.ts.map +1 -1
- package/dist/license/mint-client.d.ts +15 -4
- package/dist/license/mint-client.d.ts.map +1 -1
- package/dist/license/mint-client.js +38 -9
- package/dist/license.d.ts +39 -14
- package/dist/license.d.ts.map +1 -1
- package/dist/license.js +111 -34
- package/dist/margin-governor.d.ts +82 -0
- package/dist/margin-governor.d.ts.map +1 -0
- package/dist/margin-governor.js +143 -0
- package/dist/revforge-license-boot.d.ts +0 -10
- package/dist/revforge-license-boot.d.ts.map +1 -1
- package/dist/revforge-license-boot.js +41 -20
- package/dist/types/runtime.d.ts +3 -6
- package/dist/types/runtime.d.ts.map +1 -1
- package/dist/utils/block-conversion.d.ts.map +1 -1
- package/dist/utils/block-conversion.js +2 -1
- package/package.json +64 -3
|
@@ -7,6 +7,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
7
7
|
*/
|
|
8
8
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
9
9
|
import { logger } from '@revealui/core/utils/logger';
|
|
10
|
+
import { Button, Input } from '@revealui/presentation';
|
|
10
11
|
import { useCallback, useRef, useState } from 'react';
|
|
11
12
|
import { INSERT_IMAGE_COMMAND } from '../nodes/ImageNode.js';
|
|
12
13
|
import { deriveAltTextFromFilename, postMediaUpload } from './upload.js';
|
|
@@ -121,8 +122,5 @@ export const ImageUploadButton = ({ onUploadStart, onUploadComplete, onUploadErr
|
|
|
121
122
|
const triggerFileSelect = useCallback(() => {
|
|
122
123
|
fileInputRef.current?.click();
|
|
123
124
|
}, []);
|
|
124
|
-
return (_jsxs(_Fragment, { children: [_jsx(
|
|
125
|
-
opacity: isUploading ? 0.6 : 1,
|
|
126
|
-
cursor: isUploading ? 'wait' : 'pointer',
|
|
127
|
-
}, children: isUploading ? '⏳' : '🖼️' })] }));
|
|
125
|
+
return (_jsxs(_Fragment, { children: [_jsx(Input, { ref: fileInputRef, type: "file", accept: acceptedFileTypes, onChange: (event) => void handleFileSelect(event), className: "hidden", "aria-label": "Upload image" }), _jsx(Button, { type: "button", variant: "neutral", appearance: "ghost", size: "sm", onClick: triggerFileSelect, disabled: isUploading, className: "toolbar-btn", title: isUploading ? 'Uploading...' : 'Insert Image', "aria-label": "Insert Image", isLoading: isUploading, children: isUploading ? '⏳' : '🖼️' })] }));
|
|
128
126
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingToolbarPlugin.d.ts","sourceRoot":"","sources":["../../../../src/client/richtext/plugins/FloatingToolbarPlugin.tsx"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AA4ClE,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,wBAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,EAAE,0BAA0B,
|
|
1
|
+
{"version":3,"file":"FloatingToolbarPlugin.d.ts","sourceRoot":"","sources":["../../../../src/client/richtext/plugins/FloatingToolbarPlugin.tsx"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AA4ClE,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,wBAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,EAAE,0BAA0B,sCAua7E;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -11,6 +11,7 @@ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext
|
|
|
11
11
|
import { $createHeadingNode, $createQuoteNode, $isHeadingNode, } from '@lexical/rich-text';
|
|
12
12
|
import { $setBlocksType } from '@lexical/selection';
|
|
13
13
|
import { $findMatchingParent, $getNearestNodeOfType, mergeRegister } from '@lexical/utils';
|
|
14
|
+
import { Button, Select } from '@revealui/presentation';
|
|
14
15
|
import { $createParagraphNode, $getSelection, $isRangeSelection, $isRootOrShadowRoot, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, COMMAND_PRIORITY_CRITICAL, FORMAT_TEXT_COMMAND, REDO_COMMAND, SELECTION_CHANGE_COMMAND, UNDO_COMMAND, } from 'lexical';
|
|
15
16
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
16
17
|
import { createPortal } from 'react-dom';
|
|
@@ -231,7 +232,7 @@ export function FloatingToolbarPlugin({ features }) {
|
|
|
231
232
|
zIndex: 1000,
|
|
232
233
|
opacity: position.visible ? 1 : 0,
|
|
233
234
|
pointerEvents: position.visible ? 'auto' : 'none',
|
|
234
|
-
}, onMouseDown: (e) => e.preventDefault(), children: [hasFeature('history') && (_jsxs("div", { className: "toolbar-group", children: [_jsx("
|
|
235
|
+
}, onMouseDown: (e) => e.preventDefault(), children: [hasFeature('history') && (_jsxs("div", { className: "toolbar-group", children: [_jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", disabled: !state.canUndo, onClick: undo, className: "toolbar-btn", title: "Undo (Ctrl+Z)", "aria-label": "Undo", children: "\u21B6" }), _jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", disabled: !state.canRedo, onClick: redo, className: "toolbar-btn", title: "Redo (Ctrl+Y)", "aria-label": "Redo", children: "\u21B7" })] })), _jsxs("div", { className: "toolbar-group", children: [hasFeature('bold') && (_jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: formatBold, className: `toolbar-btn ${state.isBold ? 'active' : ''}`, title: "Bold (Ctrl+B)", "aria-label": "Bold", "aria-pressed": state.isBold, children: _jsx("strong", { children: "B" }) })), hasFeature('italic') && (_jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: formatItalic, className: `toolbar-btn ${state.isItalic ? 'active' : ''}`, title: "Italic (Ctrl+I)", "aria-label": "Italic", "aria-pressed": state.isItalic, children: _jsx("em", { children: "I" }) })), hasFeature('underline') && (_jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: formatUnderline, className: `toolbar-btn ${state.isUnderline ? 'active' : ''}`, title: "Underline (Ctrl+U)", "aria-label": "Underline", "aria-pressed": state.isUnderline, children: _jsx("span", { style: { textDecoration: 'underline' }, children: "U" }) })), hasFeature('link') && (_jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: insertLink, className: `toolbar-btn ${state.isLink ? 'active' : ''}`, title: "Insert Link", "aria-label": "Insert Link", "aria-pressed": state.isLink, children: "\uD83D\uDD17" })), hasFeature('upload') && _jsx(ImageUploadButton, {})] }), hasFeature('heading') && (_jsx("div", { className: "toolbar-group", children: _jsxs(Select, { className: "toolbar-select", value: state.blockType, onChange: (e) => {
|
|
235
236
|
const value = e.target.value;
|
|
236
237
|
if (value === 'paragraph')
|
|
237
238
|
formatParagraph();
|
|
@@ -239,7 +240,7 @@ export function FloatingToolbarPlugin({ features }) {
|
|
|
239
240
|
formatHeading(value);
|
|
240
241
|
else if (value === 'quote')
|
|
241
242
|
formatQuote();
|
|
242
|
-
}, children: [_jsx("option", { value: "paragraph", children: "Paragraph" }), _jsx("option", { value: "h1", children: "H1" }), _jsx("option", { value: "h2", children: "H2" }), _jsx("option", { value: "h3", children: "H3" })] }) })), (hasFeature('list') || hasFeature('orderedList') || hasFeature('unorderedList')) && (_jsxs("div", { className: "toolbar-group", children: [_jsx("
|
|
243
|
+
}, children: [_jsx("option", { value: "paragraph", children: "Paragraph" }), _jsx("option", { value: "h1", children: "H1" }), _jsx("option", { value: "h2", children: "H2" }), _jsx("option", { value: "h3", children: "H3" })] }) })), (hasFeature('list') || hasFeature('orderedList') || hasFeature('unorderedList')) && (_jsxs("div", { className: "toolbar-group", children: [_jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: formatBulletList, className: `toolbar-btn ${state.blockType === 'bullet' ? 'active' : ''}`, title: "Bullet List", "aria-label": "Bullet List", children: "\u2022" }), _jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: formatNumberedList, className: `toolbar-btn ${state.blockType === 'number' ? 'active' : ''}`, title: "Numbered List", "aria-label": "Numbered List", children: "1." })] }))] }));
|
|
243
244
|
// Render via portal to body for proper positioning
|
|
244
245
|
return typeof document !== 'undefined' ? createPortal(toolbarContent, document.body) : null;
|
|
245
246
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarPlugin.d.ts","sourceRoot":"","sources":["../../../../src/client/richtext/plugins/ToolbarPlugin.tsx"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAsClE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;CAC3C;AAED,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,OAAiB,EAAE,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ToolbarPlugin.d.ts","sourceRoot":"","sources":["../../../../src/client/richtext/plugins/ToolbarPlugin.tsx"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAsClE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;CAC3C;AAED,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,OAAiB,EAAE,EAAE,kBAAkB,sCAmchF;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -11,6 +11,7 @@ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext
|
|
|
11
11
|
import { $createHeadingNode, $createQuoteNode, $isHeadingNode, } from '@lexical/rich-text';
|
|
12
12
|
import { $setBlocksType } from '@lexical/selection';
|
|
13
13
|
import { $findMatchingParent, $getNearestNodeOfType, mergeRegister } from '@lexical/utils';
|
|
14
|
+
import { Button, Select } from '@revealui/presentation';
|
|
14
15
|
import { $createParagraphNode, $getSelection, $isRangeSelection, $isRootOrShadowRoot, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, COMMAND_PRIORITY_CRITICAL, FORMAT_TEXT_COMMAND, REDO_COMMAND, SELECTION_CHANGE_COMMAND, UNDO_COMMAND, } from 'lexical';
|
|
15
16
|
import { useCallback, useEffect, useState } from 'react';
|
|
16
17
|
import { ImageUploadButton } from '../components/ImageUploadButton.js';
|
|
@@ -191,7 +192,7 @@ export function ToolbarPlugin({ features, variant = 'fixed' }) {
|
|
|
191
192
|
});
|
|
192
193
|
if (!showToolbar)
|
|
193
194
|
return null;
|
|
194
|
-
return (_jsxs("div", { className: `editor-toolbar editor-toolbar--${variant}`, children: [hasFeature('history') && (_jsxs("div", { className: "toolbar-group", children: [_jsx("
|
|
195
|
+
return (_jsxs("div", { className: `editor-toolbar editor-toolbar--${variant}`, children: [hasFeature('history') && (_jsxs("div", { className: "toolbar-group", children: [_jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", disabled: !state.canUndo, onClick: undo, className: "toolbar-btn", title: "Undo (Ctrl+Z)", "aria-label": "Undo", children: "\u21B6" }), _jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", disabled: !state.canRedo, onClick: redo, className: "toolbar-btn", title: "Redo (Ctrl+Y)", "aria-label": "Redo", children: "\u21B7" })] })), hasFeature('heading') && (_jsx("div", { className: "toolbar-group", children: _jsxs(Select, { className: "toolbar-select", value: state.blockType, onChange: (e) => {
|
|
195
196
|
const value = e.target.value;
|
|
196
197
|
if (value === 'paragraph')
|
|
197
198
|
formatParagraph();
|
|
@@ -199,6 +200,6 @@ export function ToolbarPlugin({ features, variant = 'fixed' }) {
|
|
|
199
200
|
formatHeading(value);
|
|
200
201
|
else if (value === 'quote')
|
|
201
202
|
formatQuote();
|
|
202
|
-
}, children: [_jsx("option", { value: "paragraph", children: "Paragraph" }), _jsx("option", { value: "h1", children: "Heading 1" }), _jsx("option", { value: "h2", children: "Heading 2" }), _jsx("option", { value: "h3", children: "Heading 3" }), _jsx("option", { value: "h4", children: "Heading 4" })] }) })), _jsxs("div", { className: "toolbar-group", children: [hasFeature('bold') && (_jsx("
|
|
203
|
+
}, children: [_jsx("option", { value: "paragraph", children: "Paragraph" }), _jsx("option", { value: "h1", children: "Heading 1" }), _jsx("option", { value: "h2", children: "Heading 2" }), _jsx("option", { value: "h3", children: "Heading 3" }), _jsx("option", { value: "h4", children: "Heading 4" })] }) })), _jsxs("div", { className: "toolbar-group", children: [hasFeature('bold') && (_jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: formatBold, className: `toolbar-btn ${state.isBold ? 'active' : ''}`, title: "Bold (Ctrl+B)", "aria-label": "Bold", "aria-pressed": state.isBold, children: _jsx("strong", { children: "B" }) })), hasFeature('italic') && (_jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: formatItalic, className: `toolbar-btn ${state.isItalic ? 'active' : ''}`, title: "Italic (Ctrl+I)", "aria-label": "Italic", "aria-pressed": state.isItalic, children: _jsx("em", { children: "I" }) })), hasFeature('underline') && (_jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: formatUnderline, className: `toolbar-btn ${state.isUnderline ? 'active' : ''}`, title: "Underline (Ctrl+U)", "aria-label": "Underline", "aria-pressed": state.isUnderline, children: _jsx("span", { style: { textDecoration: 'underline' }, children: "U" }) })), hasFeature('strikethrough') && (_jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: formatStrikethrough, className: `toolbar-btn ${state.isStrikethrough ? 'active' : ''}`, title: "Strikethrough", "aria-label": "Strikethrough", "aria-pressed": state.isStrikethrough, children: _jsx("span", { style: { textDecoration: 'line-through' }, children: "S" }) })), hasFeature('code') && (_jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: formatCode, className: `toolbar-btn ${state.isCode ? 'active' : ''}`, title: "Inline Code", "aria-label": "Inline Code", "aria-pressed": state.isCode, children: '</>' })), hasFeature('subscript') && (_jsxs(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: formatSubscript, className: `toolbar-btn ${state.isSubscript ? 'active' : ''}`, title: "Subscript", "aria-label": "Subscript", "aria-pressed": state.isSubscript, children: ["X", _jsx("sub", { children: "2" })] })), hasFeature('superscript') && (_jsxs(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: formatSuperscript, className: `toolbar-btn ${state.isSuperscript ? 'active' : ''}`, title: "Superscript", "aria-label": "Superscript", "aria-pressed": state.isSuperscript, children: ["X", _jsx("sup", { children: "2" })] }))] }), (hasFeature('list') || hasFeature('orderedList') || hasFeature('unorderedList')) && (_jsxs("div", { className: "toolbar-group", children: [_jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: formatBulletList, className: `toolbar-btn ${state.blockType === 'bullet' ? 'active' : ''}`, title: "Bullet List", "aria-label": "Bullet List", children: "\u2022" }), _jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: formatNumberedList, className: `toolbar-btn ${state.blockType === 'number' ? 'active' : ''}`, title: "Numbered List", "aria-label": "Numbered List", children: "1." })] })), hasFeature('link') && (_jsx("div", { className: "toolbar-group", children: _jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: insertLink, className: `toolbar-btn ${state.isLink ? 'active' : ''}`, title: "Insert Link", "aria-label": "Insert Link", "aria-pressed": state.isLink, children: "\uD83D\uDD17" }) })), hasFeature('quote') && (_jsx("div", { className: "toolbar-group", children: _jsx(Button, { variant: "neutral", appearance: "ghost", size: "sm", type: "button", onClick: formatQuote, className: `toolbar-btn ${state.blockType === 'quote' ? 'active' : ''}`, title: "Block Quote", "aria-label": "Block Quote", children: "\"" }) })), hasFeature('upload') && (_jsx("div", { className: "toolbar-group", children: _jsx(ImageUploadButton, {}) }))] }));
|
|
203
204
|
}
|
|
204
205
|
export default ToolbarPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/ui/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;
|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kBAAkB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA8BtD,CAAC;AAGF,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC9E;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA2DpD,CAAC"}
|
package/dist/client/ui/index.js
CHANGED
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
'use client';
|
|
7
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { logger } from '@revealui/core/utils/logger';
|
|
9
|
+
import { CheckboxField, Button as PresentationButton, Checkbox as PresentationCheckbox, Input as PresentationInput, Select as PresentationSelect, Textarea as PresentationTextarea, } from '@revealui/presentation';
|
|
9
10
|
import React from 'react';
|
|
10
11
|
// Text input component
|
|
11
12
|
export const TextInput = ({ path, value = '', onChange, placeholder, className, readOnly, disabled, }) => {
|
|
12
|
-
return (_jsx(
|
|
13
|
+
return (_jsx(PresentationInput, { type: "text", name: path, value: value, onChange: (e) => onChange?.(e.target.value), placeholder: placeholder, className: className, readOnly: readOnly, disabled: disabled }));
|
|
13
14
|
};
|
|
14
15
|
// Field label component
|
|
15
16
|
export const FieldLabel = ({ htmlFor, label, required, className }) => {
|
|
@@ -68,16 +69,19 @@ export function useField(options) {
|
|
|
68
69
|
};
|
|
69
70
|
}
|
|
70
71
|
export const Button = ({ children, onClick, type = 'button', variant = 'primary', size = 'md', disabled, className, }) => {
|
|
71
|
-
|
|
72
|
+
const intent = variant === 'primary' ? 'brand' : variant === 'ghost' ? 'neutral' : 'neutral';
|
|
73
|
+
const appearance = variant === 'ghost' ? 'ghost' : variant === 'secondary' ? 'outline' : 'solid';
|
|
74
|
+
const mappedSize = size === 'sm' ? 'sm' : size === 'lg' ? 'lg' : 'default';
|
|
75
|
+
return (_jsx(PresentationButton, { type: type, onClick: onClick, disabled: disabled, variant: intent, appearance: appearance, size: mappedSize, className: className, children: children }));
|
|
72
76
|
};
|
|
73
77
|
export const SelectInput = ({ path, value = '', options, onChange, placeholder, className, disabled, }) => {
|
|
74
|
-
return (_jsxs(
|
|
78
|
+
return (_jsxs(PresentationSelect, { name: path, value: value, onChange: (e) => onChange?.(e.target.value), className: className, disabled: disabled, children: [placeholder && (_jsx("option", { value: "", disabled: true, children: placeholder })), options.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value)))] }));
|
|
75
79
|
};
|
|
76
80
|
export const Textarea = ({ path, value = '', onChange, placeholder, className, rows = 3, disabled, }) => {
|
|
77
|
-
return (_jsx(
|
|
81
|
+
return (_jsx(PresentationTextarea, { name: path, value: value, onChange: (e) => onChange?.(e.target.value), placeholder: placeholder, className: className, rows: rows, disabled: disabled }));
|
|
78
82
|
};
|
|
79
83
|
export const Checkbox = ({ path, checked = false, onChange, label, className, disabled, }) => {
|
|
80
|
-
return (_jsxs(
|
|
84
|
+
return (_jsxs(CheckboxField, { disabled: disabled, className: className, children: [_jsx(PresentationCheckbox, { name: path, checked: checked, onChange: (next) => onChange?.(next), disabled: disabled }), label ? _jsx("span", { children: label }) : null] }));
|
|
81
85
|
};
|
|
82
86
|
const ModalContext = React.createContext({
|
|
83
87
|
openModals: new Set(),
|
|
@@ -126,5 +130,5 @@ export const FieldsDrawer = ({ data, drawerSlug, drawerTitle, handleDrawerSubmit
|
|
|
126
130
|
e.preventDefault();
|
|
127
131
|
handleDrawerSubmit(null, formData);
|
|
128
132
|
};
|
|
129
|
-
return (_jsx("div", { className: "fields-drawer-overlay", children: _jsxs("div", { className: "fields-drawer", children: [_jsxs("div", { className: "fields-drawer-header", children: [_jsx("h3", { children: drawerTitle }), _jsx(
|
|
133
|
+
return (_jsx("div", { className: "fields-drawer-overlay", children: _jsxs("div", { className: "fields-drawer", children: [_jsxs("div", { className: "fields-drawer-header", children: [_jsx("h3", { children: drawerTitle }), _jsx(PresentationButton, { type: "button", variant: "neutral", appearance: "ghost", size: "sm", onClick: () => closeModal(drawerSlug), children: "\u00D7" })] }), _jsxs("form", { onSubmit: handleSubmit, children: [_jsx("div", { className: "fields-drawer-content", children: _jsx(TextInput, { path: "url", value: formData.url || '', onChange: (value) => setFormData({ ...formData, url: value }), placeholder: "Enter URL" }) }), _jsxs("div", { className: "fields-drawer-footer", children: [_jsx(Button, { type: "submit", variant: "primary", children: "Submit" }), _jsx(Button, { type: "button", variant: "secondary", onClick: () => closeModal(drawerSlug), children: "Cancel" })] })] })] }) }));
|
|
130
134
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GAP-256 Layer 3 — pure COGS circuit breaker decide (no DB, no I/O).
|
|
3
|
+
* Free accounts only; paying tiers never trip.
|
|
4
|
+
*/
|
|
5
|
+
export interface CogsBreakerFlags {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
dailyLimitCents: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function cogsBreakerFlagsFromEnv(env?: Record<string, string | undefined>): CogsBreakerFlags;
|
|
10
|
+
export type CogsBreakerDecideInput = {
|
|
11
|
+
tier: string;
|
|
12
|
+
costCents: number;
|
|
13
|
+
flags: CogsBreakerFlags;
|
|
14
|
+
alreadyTripped: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type CogsBreakerDecideResult = {
|
|
17
|
+
action: 'none';
|
|
18
|
+
reason: string;
|
|
19
|
+
} | {
|
|
20
|
+
action: 'trip';
|
|
21
|
+
reason: string;
|
|
22
|
+
} | {
|
|
23
|
+
action: 'already_tripped';
|
|
24
|
+
reason: string;
|
|
25
|
+
};
|
|
26
|
+
export declare function decideCogsBreakerTrip(input: CogsBreakerDecideInput): CogsBreakerDecideResult;
|
|
27
|
+
//# sourceMappingURL=cogs-breaker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cogs-breaker.d.ts","sourceRoot":"","sources":["../src/cogs-breaker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,uBAAuB,CACrC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,gBAAgB,CAIlB;AAQD,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,gBAAgB,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAC/B;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,MAAM,EAAE,iBAAiB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,sBAAsB,GAAG,uBAAuB,CAiB5F"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export function cogsBreakerFlagsFromEnv(env = process.env) {
|
|
2
|
+
const enabled = env.COGS_BREAKER_ENABLED === 'true';
|
|
3
|
+
const dailyLimitCents = parsePositiveInt(env.COGS_BREAKER_DAILY_CENTS, 1_000);
|
|
4
|
+
return { enabled, dailyLimitCents };
|
|
5
|
+
}
|
|
6
|
+
function parsePositiveInt(raw, fallback) {
|
|
7
|
+
if (raw === undefined || raw.trim() === '')
|
|
8
|
+
return fallback;
|
|
9
|
+
const n = Number.parseInt(raw, 10);
|
|
10
|
+
return Number.isFinite(n) && n > 0 ? n : fallback;
|
|
11
|
+
}
|
|
12
|
+
export function decideCogsBreakerTrip(input) {
|
|
13
|
+
if (!input.flags.enabled) {
|
|
14
|
+
return { action: 'none', reason: 'breaker_disabled' };
|
|
15
|
+
}
|
|
16
|
+
if (input.tier === 'pro' || input.tier === 'max' || input.tier === 'enterprise') {
|
|
17
|
+
return { action: 'none', reason: 'paid_tier_exempt' };
|
|
18
|
+
}
|
|
19
|
+
if (input.alreadyTripped) {
|
|
20
|
+
return { action: 'already_tripped', reason: 'already_tripped' };
|
|
21
|
+
}
|
|
22
|
+
if (input.costCents > input.flags.dailyLimitCents) {
|
|
23
|
+
return {
|
|
24
|
+
action: 'trip',
|
|
25
|
+
reason: `daily_cogs_${input.costCents}_gt_${input.flags.dailyLimitCents}`,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return { action: 'none', reason: 'under_limit' };
|
|
29
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../../src/error-handling/error-boundary.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../../src/error-handling/error-boundary.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzD,MAAM,WAAW,SAAS;IACxB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK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EpE;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,qBAAqB,CAEtF;AAED,iGAAiG;AACjG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,qBAAqB,CAEhF;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAKlF;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAItE;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAEnE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAO5D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAStD"}
|
|
@@ -4,6 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
*
|
|
5
5
|
* Catch and handle React component errors gracefully
|
|
6
6
|
*/
|
|
7
|
+
import { Button } from '@revealui/presentation';
|
|
7
8
|
/// <reference types="react" />
|
|
8
9
|
import React, { Component } from 'react';
|
|
9
10
|
import { logger } from '../observability/logger.js';
|
|
@@ -106,15 +107,7 @@ function DefaultErrorFallback({ error, errorInfo, onReset, isolate, }) {
|
|
|
106
107
|
borderRadius: '4px',
|
|
107
108
|
overflow: 'auto',
|
|
108
109
|
fontSize: '12px',
|
|
109
|
-
}, children: errorInfo?.componentStack })] })), _jsx(
|
|
110
|
-
marginTop: '16px',
|
|
111
|
-
padding: '8px 16px',
|
|
112
|
-
backgroundColor: 'var(--rvui-brand, #2196f3)',
|
|
113
|
-
color: '#fff',
|
|
114
|
-
border: 'none',
|
|
115
|
-
borderRadius: '4px',
|
|
116
|
-
cursor: 'pointer',
|
|
117
|
-
}, children: "Try again" })] }));
|
|
110
|
+
}, children: errorInfo?.componentStack })] })), _jsx(Button, { type: "button", variant: "brand", appearance: "solid", onClick: onReset, className: "mt-4", children: "Try again" })] }));
|
|
118
111
|
}
|
|
119
112
|
export class ErrorBoundaryWithRetry extends Component {
|
|
120
113
|
retryTimeout;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fallback-components.d.ts","sourceRoot":"","sources":["../../src/error-handling/fallback-components.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"fallback-components.d.ts","sourceRoot":"","sources":["../../src/error-handling/fallback-components.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,OAAO,EACP,SAAS,EACT,KAA8B,EAC9B,OAAO,EACP,WAAoD,EACpD,OAAe,GAChB,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAgGzC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,OAAmF,GACpF,EAAE;IACD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,KAAK,CAAC,YAAY,CAoBrB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAwB,EACxB,OAAwD,EACxD,QAAQ,GACT,EAAE;IACD,KAA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E;IACD,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,GAAG,KAAK,CAAC,YAAY,CA2ErB;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAc,EACd,MAAe,EACf,YAAoB,GACrB,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,KAAK,CAAC,YAAY,CAqBrB"}
|
|
@@ -4,6 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
4
4
|
*
|
|
5
5
|
* Reusable fallback components for error states, loading states, and degraded functionality
|
|
6
6
|
*/
|
|
7
|
+
import { Button } from '@revealui/presentation';
|
|
7
8
|
/// <reference types="react" />
|
|
8
9
|
import React, {} from 'react';
|
|
9
10
|
/**
|
|
@@ -17,16 +18,7 @@ export function ErrorFallback({ error, onRetry, onDismiss, title = 'Something we
|
|
|
17
18
|
border: '1px solid var(--rvui-error, #fcc)',
|
|
18
19
|
borderRadius: '4px',
|
|
19
20
|
color: 'var(--rvui-error, #c00)',
|
|
20
|
-
}, children: [_jsx("strong", { children: title }), message && _jsx("p", { style: { margin: '4px 0 0 0', fontSize: '14px' }, children: message }), onRetry && (_jsx(
|
|
21
|
-
marginTop: '8px',
|
|
22
|
-
padding: '4px 12px',
|
|
23
|
-
fontSize: '12px',
|
|
24
|
-
backgroundColor: 'var(--rvui-error, #c00)',
|
|
25
|
-
color: '#fff',
|
|
26
|
-
border: 'none',
|
|
27
|
-
borderRadius: '4px',
|
|
28
|
-
cursor: 'pointer',
|
|
29
|
-
}, children: "Retry" }))] }));
|
|
21
|
+
}, children: [_jsx("strong", { children: title }), message && _jsx("p", { style: { margin: '4px 0 0 0', fontSize: '14px' }, children: message }), onRetry && (_jsx(Button, { type: "button", variant: "danger", appearance: "solid", size: "sm", onClick: onRetry, className: "mt-2", children: "Retry" }))] }));
|
|
30
22
|
}
|
|
31
23
|
return (_jsxs("div", { role: "alert", style: {
|
|
32
24
|
padding: '24px',
|
|
@@ -51,22 +43,7 @@ export function ErrorFallback({ error, onRetry, onDismiss, title = 'Something we
|
|
|
51
43
|
overflow: 'auto',
|
|
52
44
|
fontSize: '12px',
|
|
53
45
|
color: 'var(--rvui-error, #c00)',
|
|
54
|
-
}, children: [error.name, ": ", error.message, error.stack && `\n\n${error.stack}`] })] })), _jsxs("div", { style: { marginTop: '24px', display: 'flex', gap: '12px' }, children: [onRetry && (_jsx("button", { type: "button", onClick:
|
|
55
|
-
padding: '10px 20px',
|
|
56
|
-
backgroundColor: 'var(--rvui-brand, #2196f3)',
|
|
57
|
-
color: '#fff',
|
|
58
|
-
border: 'none',
|
|
59
|
-
borderRadius: '4px',
|
|
60
|
-
cursor: 'pointer',
|
|
61
|
-
fontWeight: 'bold',
|
|
62
|
-
}, children: "Try Again" })), onDismiss && (_jsx("button", { type: "button", onClick: onDismiss, style: {
|
|
63
|
-
padding: '10px 20px',
|
|
64
|
-
backgroundColor: 'var(--rvui-surface-0, #fff)',
|
|
65
|
-
color: 'var(--rvui-text-2, #666)',
|
|
66
|
-
border: '1px solid var(--rvui-border, #ddd)',
|
|
67
|
-
borderRadius: '4px',
|
|
68
|
-
cursor: 'pointer',
|
|
69
|
-
}, children: "Dismiss" }))] })] }));
|
|
46
|
+
}, children: [error.name, ": ", error.message, error.stack && `\n\n${error.stack}`] })] })), _jsxs("div", { style: { marginTop: '24px', display: 'flex', gap: '12px' }, children: [onRetry && (_jsx(Button, { type: "button", variant: "brand", appearance: "solid", onClick: onRetry, children: "Try Again" })), onDismiss && (_jsx(Button, { type: "button", variant: "neutral", appearance: "outline", onClick: onDismiss, children: "Dismiss" }))] })] }));
|
|
70
47
|
}
|
|
71
48
|
/**
|
|
72
49
|
* Network error fallback
|
|
@@ -77,16 +54,7 @@ export function NetworkErrorFallback({ onRetry, message = 'Unable to connect to
|
|
|
77
54
|
textAlign: 'center',
|
|
78
55
|
maxWidth: '400px',
|
|
79
56
|
margin: '40px auto',
|
|
80
|
-
}, children: [_jsx("div", { style: { fontSize: '48px', marginBottom: '16px' }, children: "\uD83D\uDCE1" }), _jsx("h3", { style: { color: 'var(--rvui-text-1, #333)', marginTop: 0 }, children: "Connection Error" }), _jsx("p", { style: { color: 'var(--rvui-text-2, #666)', lineHeight: 1.6 }, children: message }), onRetry && (_jsx(
|
|
81
|
-
marginTop: '16px',
|
|
82
|
-
padding: '10px 20px',
|
|
83
|
-
backgroundColor: 'var(--rvui-brand, #2196f3)',
|
|
84
|
-
color: '#fff',
|
|
85
|
-
border: 'none',
|
|
86
|
-
borderRadius: '4px',
|
|
87
|
-
cursor: 'pointer',
|
|
88
|
-
fontWeight: 'bold',
|
|
89
|
-
}, children: "Retry Connection" }))] }));
|
|
57
|
+
}, children: [_jsx("div", { style: { fontSize: '48px', marginBottom: '16px' }, children: "\uD83D\uDCE1" }), _jsx("h3", { style: { color: 'var(--rvui-text-1, #333)', marginTop: 0 }, children: "Connection Error" }), _jsx("p", { style: { color: 'var(--rvui-text-2, #666)', lineHeight: 1.6 }, children: message }), onRetry && (_jsx(Button, { type: "button", variant: "brand", appearance: "solid", onClick: onRetry, className: "mt-4", children: "Retry Connection" }))] }));
|
|
90
58
|
}
|
|
91
59
|
/**
|
|
92
60
|
* Not found fallback
|
|
@@ -97,16 +65,7 @@ export function NotFoundFallback({ title = 'Page Not Found', message = 'The page
|
|
|
97
65
|
textAlign: 'center',
|
|
98
66
|
maxWidth: '400px',
|
|
99
67
|
margin: '40px auto',
|
|
100
|
-
}, children: [_jsx("div", { style: { fontSize: '72px', marginBottom: '16px' }, children: "404" }), _jsx("h2", { style: { color: 'var(--rvui-text-1, #333)', marginTop: 0 }, children: title }), _jsx("p", { style: { color: 'var(--rvui-text-2, #666)', lineHeight: 1.6 }, children: message }), onGoHome && (_jsx(
|
|
101
|
-
marginTop: '16px',
|
|
102
|
-
padding: '10px 20px',
|
|
103
|
-
backgroundColor: 'var(--rvui-brand, #2196f3)',
|
|
104
|
-
color: '#fff',
|
|
105
|
-
border: 'none',
|
|
106
|
-
borderRadius: '4px',
|
|
107
|
-
cursor: 'pointer',
|
|
108
|
-
fontWeight: 'bold',
|
|
109
|
-
}, children: "Go Home" }))] }));
|
|
68
|
+
}, children: [_jsx("div", { style: { fontSize: '72px', marginBottom: '16px' }, children: "404" }), _jsx("h2", { style: { color: 'var(--rvui-text-1, #333)', marginTop: 0 }, children: title }), _jsx("p", { style: { color: 'var(--rvui-text-2, #666)', lineHeight: 1.6 }, children: message }), onGoHome && (_jsx(Button, { type: "button", variant: "brand", appearance: "solid", onClick: onGoHome, className: "mt-4", children: "Go Home" }))] }));
|
|
110
69
|
}
|
|
111
70
|
/**
|
|
112
71
|
* Loading fallback with retry
|
|
@@ -194,22 +153,7 @@ export function PermissionDeniedFallback({ message = 'You do not have permission
|
|
|
194
153
|
textAlign: 'center',
|
|
195
154
|
maxWidth: '400px',
|
|
196
155
|
margin: '40px auto',
|
|
197
|
-
}, children: [_jsx("div", { style: { fontSize: '64px', marginBottom: '16px' }, children: "\uD83D\uDD12" }), _jsx("h2", { style: { color: 'var(--rvui-text-1, #333)', marginTop: 0 }, children: "Access Denied" }), _jsx("p", { style: { color: 'var(--rvui-text-2, #666)', lineHeight: 1.6 }, children: message }), _jsxs("div", { style: { marginTop: '24px', display: 'flex', gap: '12px', justifyContent: 'center' }, children: [onRequestAccess && (_jsx("button", { type: "button", onClick:
|
|
198
|
-
padding: '10px 20px',
|
|
199
|
-
backgroundColor: 'var(--rvui-brand, #2196f3)',
|
|
200
|
-
color: '#fff',
|
|
201
|
-
border: 'none',
|
|
202
|
-
borderRadius: '4px',
|
|
203
|
-
cursor: 'pointer',
|
|
204
|
-
fontWeight: 'bold',
|
|
205
|
-
}, children: "Request Access" })), onGoBack && (_jsx("button", { type: "button", onClick: onGoBack, style: {
|
|
206
|
-
padding: '10px 20px',
|
|
207
|
-
backgroundColor: 'var(--rvui-surface-0, #fff)',
|
|
208
|
-
color: 'var(--rvui-text-2, #666)',
|
|
209
|
-
border: '1px solid var(--rvui-border, #ddd)',
|
|
210
|
-
borderRadius: '4px',
|
|
211
|
-
cursor: 'pointer',
|
|
212
|
-
}, children: "Go Back" }))] })] }));
|
|
156
|
+
}, children: [_jsx("div", { style: { fontSize: '64px', marginBottom: '16px' }, children: "\uD83D\uDD12" }), _jsx("h2", { style: { color: 'var(--rvui-text-1, #333)', marginTop: 0 }, children: "Access Denied" }), _jsx("p", { style: { color: 'var(--rvui-text-2, #666)', lineHeight: 1.6 }, children: message }), _jsxs("div", { style: { marginTop: '24px', display: 'flex', gap: '12px', justifyContent: 'center' }, children: [onRequestAccess && (_jsx(Button, { type: "button", variant: "brand", appearance: "solid", onClick: onRequestAccess, children: "Request Access" })), onGoBack && (_jsx(Button, { type: "button", variant: "neutral", appearance: "outline", onClick: onGoBack, children: "Go Back" }))] })] }));
|
|
213
157
|
}
|
|
214
158
|
/**
|
|
215
159
|
* Retry boundary - wrapper that provides retry functionality
|
|
@@ -279,14 +223,7 @@ export function InlineError({ message, onDismiss, }) {
|
|
|
279
223
|
display: 'flex',
|
|
280
224
|
alignItems: 'center',
|
|
281
225
|
justifyContent: 'space-between',
|
|
282
|
-
}, children: [_jsxs("span", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx("span", { style: { marginRight: '8px' }, children: "\u26A0\uFE0F" }), message] }), onDismiss && (_jsx(
|
|
283
|
-
background: 'none',
|
|
284
|
-
border: 'none',
|
|
285
|
-
color: 'var(--rvui-error, #c00)',
|
|
286
|
-
cursor: 'pointer',
|
|
287
|
-
fontSize: '18px',
|
|
288
|
-
padding: '0 4px',
|
|
289
|
-
}, "aria-label": "Dismiss", children: "\u00D7" }))] }));
|
|
226
|
+
}, children: [_jsxs("span", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx("span", { style: { marginRight: '8px' }, children: "\u26A0\uFE0F" }), message] }), onDismiss && (_jsx(Button, { type: "button", variant: "danger", appearance: "ghost", size: "icon", onClick: onDismiss, "aria-label": "Dismiss", className: "size-8", children: "\u00D7" }))] }));
|
|
290
227
|
}
|
|
291
228
|
/**
|
|
292
229
|
* Success message
|
|
@@ -301,14 +238,7 @@ export function SuccessMessage({ message, onDismiss, }) {
|
|
|
301
238
|
display: 'flex',
|
|
302
239
|
alignItems: 'center',
|
|
303
240
|
justifyContent: 'space-between',
|
|
304
|
-
}, children: [_jsxs("span", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx("span", { style: { marginRight: '8px' }, children: "\u2713" }), message] }), onDismiss && (_jsx(
|
|
305
|
-
background: 'none',
|
|
306
|
-
border: 'none',
|
|
307
|
-
color: 'var(--rvui-success, #060)',
|
|
308
|
-
cursor: 'pointer',
|
|
309
|
-
fontSize: '18px',
|
|
310
|
-
padding: '0 4px',
|
|
311
|
-
}, "aria-label": "Dismiss", children: "\u00D7" }))] }));
|
|
241
|
+
}, children: [_jsxs("span", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx("span", { style: { marginRight: '8px' }, children: "\u2713" }), message] }), onDismiss && (_jsx(Button, { type: "button", variant: "success", appearance: "ghost", size: "icon", onClick: onDismiss, "aria-label": "Dismiss", className: "size-8", children: "\u00D7" }))] }));
|
|
312
242
|
}
|
|
313
243
|
/**
|
|
314
244
|
* Toast notification
|
|
@@ -363,14 +293,7 @@ export function Toast({ type = 'info', message, duration = 5000, onDismiss, }) {
|
|
|
363
293
|
gap: '12px',
|
|
364
294
|
maxWidth: '400px',
|
|
365
295
|
zIndex: 9999,
|
|
366
|
-
}, children: [_jsx("span", { style: { fontSize: '20px' }, children: color.icon }), _jsx("span", { style: { flex: 1 }, children: message }), onDismiss && (_jsx(
|
|
367
|
-
background: 'none',
|
|
368
|
-
border: 'none',
|
|
369
|
-
color: color.text,
|
|
370
|
-
cursor: 'pointer',
|
|
371
|
-
fontSize: '20px',
|
|
372
|
-
padding: '0 4px',
|
|
373
|
-
}, "aria-label": "Dismiss", children: "\u00D7" }))] }));
|
|
296
|
+
}, children: [_jsx("span", { style: { fontSize: '20px' }, children: color.icon }), _jsx("span", { style: { flex: 1 }, children: message }), onDismiss && (_jsx(Button, { type: "button", variant: "neutral", appearance: "ghost", size: "icon", onClick: onDismiss, "aria-label": "Dismiss", className: "size-8", style: { color: color.text }, children: "\u00D7" }))] }));
|
|
374
297
|
}
|
|
375
298
|
/**
|
|
376
299
|
* Skeleton loader
|
|
@@ -12,11 +12,12 @@
|
|
|
12
12
|
* in the D2 PR). setup/scripts CLI loggers are out of scope.
|
|
13
13
|
*/
|
|
14
14
|
import { type Logger as UtilsLogger } from '@revealui/utils/logger';
|
|
15
|
+
/** Instance-shaped logger. SSOT also re-exported from `types/runtime`. */
|
|
15
16
|
export interface RevealUILogger {
|
|
16
17
|
info: (...args: unknown[]) => void;
|
|
17
18
|
warn: (...args: unknown[]) => void;
|
|
18
19
|
error: (...args: unknown[]) => void;
|
|
19
|
-
debug
|
|
20
|
+
debug?: (...args: unknown[]) => void;
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* Adapts structured utils logger to the historical varargs instance API.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/instance/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAGL,KAAK,MAAM,IAAI,WAAW,EAE3B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACnC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACpC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/instance/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAGL,KAAK,MAAM,IAAI,WAAW,EAE3B,MAAM,wBAAwB,CAAC;AAEhC,0EAA0E;AAC1E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACnC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACpC,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACtC;AAoCD;;GAEG;AACH,qBAAa,MAAO,YAAW,cAAc;IAC3C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;gBAE1B,OAAO,GAAE,WAAyB;IAI9C,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAS9B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAS9B,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAS/B,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;CAQhC;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,cAAc,CAE7C;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,cAA6B,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* License mint client (GAP-260 P4-3).
|
|
2
|
+
* License mint client (GAP-260 P4-3 + residual hosted gate).
|
|
3
3
|
*
|
|
4
4
|
* Single entry for online mint surfaces (Stripe webhooks, admin generate).
|
|
5
5
|
* Routes to either:
|
|
6
6
|
* - remote `apps/license-signer` POST /internal/mint when
|
|
7
|
-
* REVEALUI_LICENSE_SIGN_VIA_SIGNER is truthy, or
|
|
7
|
+
* REVEALUI_LICENSE_SIGN_VIA_SIGNER is truthy, or when
|
|
8
|
+
* REVEALUI_DEPLOYMENT_MODE=hosted (explicit; never local private-key mint), or
|
|
8
9
|
* - local {@link generateLicenseKey} with REVEALUI_LICENSE_PRIVATE_KEY
|
|
9
|
-
*
|
|
10
|
+
* only when MODE is not hosted and SIGN_VIA is off (tests / dogfood).
|
|
10
11
|
*
|
|
11
12
|
* Offline stamper (revforge) keeps calling generateLicenseKey directly.
|
|
12
13
|
*
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
* REVEALUI_LICENSE_SIGN_VIA_SIGNER=1|true|yes|on
|
|
15
16
|
* REVEALUI_LICENSE_SIGNER_URL base URL (e.g. http://127.0.0.1:8791)
|
|
16
17
|
* REVEALUI_SIGNER_INVOKE_SECRET HMAC secret (no REVEALUI_SECRET fallback)
|
|
18
|
+
* REVEALUI_DEPLOYMENT_MODE=hosted forces remote-only (SIGN_VIA required)
|
|
17
19
|
*
|
|
18
20
|
* Env (local path):
|
|
19
21
|
* REVEALUI_LICENSE_PRIVATE_KEY PKCS#8 Ed25519 PEM (required)
|
|
@@ -51,10 +53,18 @@ export declare class LicenseMintRemoteError extends Error {
|
|
|
51
53
|
}
|
|
52
54
|
/** Truthy flag values for REVEALUI_LICENSE_SIGN_VIA_SIGNER. */
|
|
53
55
|
export declare function isSignViaSigner(env?: MintEnv): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Explicit hosted SaaS posture only. Does not use private-key inference
|
|
58
|
+
* (that belongs to detectDeploymentMode). Hosted online mint must never
|
|
59
|
+
* fall through to mintLocal.
|
|
60
|
+
*/
|
|
61
|
+
export declare function isExplicitHostedMintMode(env?: MintEnv): boolean;
|
|
54
62
|
/**
|
|
55
63
|
* Whether this process can mint a license key (local private key OR remote
|
|
56
64
|
* signer fully configured). Used by call sites that used to gate only on
|
|
57
65
|
* REVEALUI_LICENSE_PRIVATE_KEY presence.
|
|
66
|
+
*
|
|
67
|
+
* Explicit MODE=hosted never treats a local private key as sufficient.
|
|
58
68
|
*/
|
|
59
69
|
export declare function canMintLicense(env?: MintEnv): boolean;
|
|
60
70
|
/** Human-readable reason mint is unavailable (for CRITICAL logs). */
|
|
@@ -72,7 +82,8 @@ export type MintLicenseKeyOptions = {
|
|
|
72
82
|
fetch?: typeof fetch;
|
|
73
83
|
};
|
|
74
84
|
/**
|
|
75
|
-
* Mint a signed license JWT — remote signer when
|
|
85
|
+
* Mint a signed license JWT — remote signer when SIGN_VIA is on or MODE is
|
|
86
|
+
* explicitly hosted; else local private key (tests / dogfood only).
|
|
76
87
|
*/
|
|
77
88
|
export declare function mintLicenseKey(input: MintLicensePayload, options?: MintLicenseKeyOptions): Promise<string>;
|
|
78
89
|
//# sourceMappingURL=mint-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mint-client.d.ts","sourceRoot":"","sources":["../../src/license/mint-client.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mint-client.d.ts","sourceRoot":"","sources":["../../src/license/mint-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AACrE,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AACrE,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAEjD,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEzD,8EAA8E;AAC9E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,YAAY,CAAC;IACn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