made-refine 0.1.2 → 0.1.5
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 +16 -0
- package/dist/babel.cjs +37 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +535 -336
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +535 -336
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -5
- package/babel/index.cjs +0 -45
- package/vite/index.ts +0 -157
- package/vite/transform.test.ts +0 -95
- /package/{vite/index.d.ts → dist/vite.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -354,6 +354,22 @@ These utilities require DOM APIs and must run in the browser:
|
|
|
354
354
|
- React 18+
|
|
355
355
|
- Next.js 13+ or Vite 4+
|
|
356
356
|
|
|
357
|
+
## Release to npm
|
|
358
|
+
|
|
359
|
+
Publishing is handled by GitHub Actions via `.github/workflows/publish.yml`.
|
|
360
|
+
|
|
361
|
+
1. Go to **Actions** -> **Publish** -> **Run workflow**.
|
|
362
|
+
2. Run it from the `main` branch.
|
|
363
|
+
3. Choose `task`:
|
|
364
|
+
- `release`: bump version and publish
|
|
365
|
+
- `unpublish`: remove selected versions from npm
|
|
366
|
+
4. For `release`, choose `bump` (`patch`, `minor`, `major`, or `prerelease`).
|
|
367
|
+
5. If using `prerelease`, set `preid` (default: `beta`).
|
|
368
|
+
6. Keep `npm_tag` as `auto` (stable -> `latest`, prerelease -> `beta`) or override it.
|
|
369
|
+
7. For `unpublish`, set `unpublish_versions` and `confirm_unpublish=UNPUBLISH`.
|
|
370
|
+
|
|
371
|
+
For release, the workflow bumps `package.json` + lockfile version, creates a git tag, pushes to `main`, and publishes to npm with provenance.
|
|
372
|
+
|
|
357
373
|
## CSS Variables
|
|
358
374
|
|
|
359
375
|
The package uses CSS variables for theming. It will use your app's existing shadcn/ui theme if available, or fall back to sensible defaults:
|
package/dist/babel.cjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// babel/index.cjs
|
|
4
|
+
var path = require("path");
|
|
5
|
+
function isHostElement(name) {
|
|
6
|
+
return /^[a-z]/.test(name);
|
|
7
|
+
}
|
|
8
|
+
module.exports = function directEditSourcePlugin({ types: t }) {
|
|
9
|
+
return {
|
|
10
|
+
name: "direct-edit-source",
|
|
11
|
+
visitor: {
|
|
12
|
+
JSXOpeningElement(nodePath, state) {
|
|
13
|
+
const { node } = nodePath;
|
|
14
|
+
if (!t.isJSXIdentifier(node.name)) return;
|
|
15
|
+
if (!isHostElement(node.name.name)) return;
|
|
16
|
+
const filename = state.file?.opts?.filename;
|
|
17
|
+
if (!filename) return;
|
|
18
|
+
const normalized = filename.replace(/\\/g, "/");
|
|
19
|
+
if (normalized.includes("/node_modules/")) return;
|
|
20
|
+
if (normalized.includes("/node_modules/made-refine/")) return;
|
|
21
|
+
if (!node.loc?.start) return;
|
|
22
|
+
const hasAttribute = node.attributes.some((attr) => {
|
|
23
|
+
return t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name, { name: "data-direct-edit-source" });
|
|
24
|
+
});
|
|
25
|
+
if (hasAttribute) return;
|
|
26
|
+
const relative = path.relative(process.cwd(), filename).replace(/\\/g, "/");
|
|
27
|
+
const file = `/[project]/${relative}`;
|
|
28
|
+
const line = node.loc.start.line;
|
|
29
|
+
const column = node.loc.start.column + 1;
|
|
30
|
+
const value = `${file}:${line}:${column}`;
|
|
31
|
+
node.attributes.push(
|
|
32
|
+
t.jsxAttribute(t.jsxIdentifier("data-direct-edit-source"), t.stringLiteral(value))
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
};
|
package/dist/index.d.mts
CHANGED
|
@@ -37,6 +37,7 @@ interface DirectEditContextValue extends DirectEditState {
|
|
|
37
37
|
updateBorderRadiusProperty: (key: BorderRadiusPropertyKey, value: CSSPropertyValue) => void;
|
|
38
38
|
updateBorderProperty: (key: BorderPropertyKey, value: BorderProperties[BorderPropertyKey]) => void;
|
|
39
39
|
updateBorderProperties: (changes: Array<[BorderPropertyKey, BorderProperties[BorderPropertyKey]]>) => void;
|
|
40
|
+
updateRawCSS: (properties: Record<string, string>) => void;
|
|
40
41
|
updateFlexProperty: (key: FlexPropertyKey, value: string) => void;
|
|
41
42
|
toggleFlexLayout: () => void;
|
|
42
43
|
updateSizingProperty: (key: SizingPropertyKey, value: SizingValue) => void;
|
|
@@ -127,6 +128,7 @@ interface DirectEditPanelInnerProps {
|
|
|
127
128
|
onUpdateBorderRadius: (key: BorderRadiusPropertyKey, value: CSSPropertyValue) => void;
|
|
128
129
|
onUpdateBorder: (key: BorderPropertyKey, value: BorderProperties[BorderPropertyKey]) => void;
|
|
129
130
|
onBatchUpdateBorder: (changes: Array<[BorderPropertyKey, BorderProperties[BorderPropertyKey]]>) => void;
|
|
131
|
+
onSetCSS: (properties: Record<string, string>) => void;
|
|
130
132
|
onUpdateFlex: (key: 'flexDirection' | 'justifyContent' | 'alignItems', value: string) => void;
|
|
131
133
|
onToggleFlex: () => void;
|
|
132
134
|
onUpdateSizing: (key: SizingPropertyKey, value: SizingValue) => void;
|
|
@@ -143,7 +145,7 @@ interface DirectEditPanelInnerProps {
|
|
|
143
145
|
onHeaderPointerMove?: (e: React.PointerEvent) => void;
|
|
144
146
|
onHeaderPointerUp?: (e: React.PointerEvent) => void;
|
|
145
147
|
}
|
|
146
|
-
declare function DirectEditPanelInner({ elementInfo, computedSpacing, computedBorderRadius, computedBorder, computedFlex, computedSizing, computedColor, computedTypography, pendingStyles, onClose, onSelectParent, onSelectChild, onUpdateSpacing, onUpdateBorderRadius, onUpdateBorder, onBatchUpdateBorder, onUpdateFlex, onToggleFlex, onUpdateSizing, onUpdateColor, onUpdateTypography, onReset, onExportEdits, onSendToAgent, className, style, panelRef, isDragging, onHeaderPointerDown, onHeaderPointerMove, onHeaderPointerUp, }: DirectEditPanelInnerProps): react_jsx_runtime.JSX.Element;
|
|
148
|
+
declare function DirectEditPanelInner({ elementInfo, computedSpacing, computedBorderRadius, computedBorder, computedFlex, computedSizing, computedColor, computedTypography, pendingStyles, onClose, onSelectParent, onSelectChild, onUpdateSpacing, onUpdateBorderRadius, onUpdateBorder, onBatchUpdateBorder, onSetCSS, onUpdateFlex, onToggleFlex, onUpdateSizing, onUpdateColor, onUpdateTypography, onReset, onExportEdits, onSendToAgent, className, style, panelRef, isDragging, onHeaderPointerDown, onHeaderPointerMove, onHeaderPointerUp, }: DirectEditPanelInnerProps): react_jsx_runtime.JSX.Element;
|
|
147
149
|
declare function DirectEditPanel(): react_jsx_runtime.JSX.Element | null;
|
|
148
150
|
|
|
149
151
|
interface DirectEditToolbarInnerProps {
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ interface DirectEditContextValue extends DirectEditState {
|
|
|
37
37
|
updateBorderRadiusProperty: (key: BorderRadiusPropertyKey, value: CSSPropertyValue) => void;
|
|
38
38
|
updateBorderProperty: (key: BorderPropertyKey, value: BorderProperties[BorderPropertyKey]) => void;
|
|
39
39
|
updateBorderProperties: (changes: Array<[BorderPropertyKey, BorderProperties[BorderPropertyKey]]>) => void;
|
|
40
|
+
updateRawCSS: (properties: Record<string, string>) => void;
|
|
40
41
|
updateFlexProperty: (key: FlexPropertyKey, value: string) => void;
|
|
41
42
|
toggleFlexLayout: () => void;
|
|
42
43
|
updateSizingProperty: (key: SizingPropertyKey, value: SizingValue) => void;
|
|
@@ -127,6 +128,7 @@ interface DirectEditPanelInnerProps {
|
|
|
127
128
|
onUpdateBorderRadius: (key: BorderRadiusPropertyKey, value: CSSPropertyValue) => void;
|
|
128
129
|
onUpdateBorder: (key: BorderPropertyKey, value: BorderProperties[BorderPropertyKey]) => void;
|
|
129
130
|
onBatchUpdateBorder: (changes: Array<[BorderPropertyKey, BorderProperties[BorderPropertyKey]]>) => void;
|
|
131
|
+
onSetCSS: (properties: Record<string, string>) => void;
|
|
130
132
|
onUpdateFlex: (key: 'flexDirection' | 'justifyContent' | 'alignItems', value: string) => void;
|
|
131
133
|
onToggleFlex: () => void;
|
|
132
134
|
onUpdateSizing: (key: SizingPropertyKey, value: SizingValue) => void;
|
|
@@ -143,7 +145,7 @@ interface DirectEditPanelInnerProps {
|
|
|
143
145
|
onHeaderPointerMove?: (e: React.PointerEvent) => void;
|
|
144
146
|
onHeaderPointerUp?: (e: React.PointerEvent) => void;
|
|
145
147
|
}
|
|
146
|
-
declare function DirectEditPanelInner({ elementInfo, computedSpacing, computedBorderRadius, computedBorder, computedFlex, computedSizing, computedColor, computedTypography, pendingStyles, onClose, onSelectParent, onSelectChild, onUpdateSpacing, onUpdateBorderRadius, onUpdateBorder, onBatchUpdateBorder, onUpdateFlex, onToggleFlex, onUpdateSizing, onUpdateColor, onUpdateTypography, onReset, onExportEdits, onSendToAgent, className, style, panelRef, isDragging, onHeaderPointerDown, onHeaderPointerMove, onHeaderPointerUp, }: DirectEditPanelInnerProps): react_jsx_runtime.JSX.Element;
|
|
148
|
+
declare function DirectEditPanelInner({ elementInfo, computedSpacing, computedBorderRadius, computedBorder, computedFlex, computedSizing, computedColor, computedTypography, pendingStyles, onClose, onSelectParent, onSelectChild, onUpdateSpacing, onUpdateBorderRadius, onUpdateBorder, onBatchUpdateBorder, onSetCSS, onUpdateFlex, onToggleFlex, onUpdateSizing, onUpdateColor, onUpdateTypography, onReset, onExportEdits, onSendToAgent, className, style, panelRef, isDragging, onHeaderPointerDown, onHeaderPointerMove, onHeaderPointerUp, }: DirectEditPanelInnerProps): react_jsx_runtime.JSX.Element;
|
|
147
149
|
declare function DirectEditPanel(): react_jsx_runtime.JSX.Element | null;
|
|
148
150
|
|
|
149
151
|
interface DirectEditToolbarInnerProps {
|