@arpproject/recrate 0.1.2 → 0.1.4
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 +5 -5
- package/dist/crate-builder/emotionCache.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/recrate.css +1896 -0
- package/dist/recrate.es.js +63295 -104099
- package/dist/recrate.umd.js +35999 -76803
- package/package.json +9 -7
- package/postcss.config.cjs +1 -1
- package/src/app/EmbeddedComponent.tsx +3 -3
- package/src/crate-builder/RenderEntity/ItemLink.tsx +1 -1
- package/src/crate-builder/RenderEntity/RenderControls.tsx +2 -2
- package/src/crate-builder/RenderEntity/RenderLinkedItem.tsx +1 -1
- package/src/crate-builder/RenderEntity/RenderReverseConnections.tsx +2 -2
- package/src/crate-builder/Shell.tsx +31 -17
- package/src/crate-builder/emotionCache.ts +8 -0
- package/src/crate-builder/primitives/Number.tsx +1 -1
- package/src/crate-builder/primitives/Select.tsx +5 -6
- package/src/crate-builder/primitives/Text.tsx +1 -1
- package/src/crate-builder/primitives/Url.tsx +1 -1
- package/src/crate-builder/recrate.css +3 -0
- package/src/crate-builder/tailwind.css +1 -3
- package/src/index.ts +2 -0
- package/tailwind.config.js +1 -0
- package/vite.config.ts +6 -1
- package/dist/style.css +0 -1721
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arpproject/recrate",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"main": "dist/describo-crate-builder.umd.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"import": "./dist/recrate.es.js",
|
|
9
|
-
"require": "./dist/recrate.umd.js"
|
|
9
|
+
"require": "./dist/recrate.umd.js",
|
|
10
|
+
"default": "./dist/index.d.ts"
|
|
10
11
|
},
|
|
11
12
|
"./style.css": {
|
|
12
|
-
"import": "./dist/
|
|
13
|
+
"import": "./dist/recrate.css"
|
|
13
14
|
}
|
|
14
15
|
},
|
|
15
16
|
"types": "dist/index.d.ts",
|
|
@@ -18,6 +19,7 @@
|
|
|
18
19
|
"@codemirror/lang-javascript": "^6.2.3",
|
|
19
20
|
"@codemirror/state": "^6.5.2",
|
|
20
21
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
22
|
+
"@emotion/cache": "^11.14.0",
|
|
21
23
|
"@emotion/react": "^11.14.0",
|
|
22
24
|
"@emotion/styled": "^11.14.0",
|
|
23
25
|
"@fortawesome/fontawesome-free": "^6.7.2",
|
|
@@ -31,6 +33,7 @@
|
|
|
31
33
|
"@mui/material": "^7.1.0",
|
|
32
34
|
"@mui/system": "^7.1.0",
|
|
33
35
|
"@mui/x-date-pickers": "^8.2.0",
|
|
36
|
+
"@tailwindcss/postcss": "^4.1.16",
|
|
34
37
|
"@terraformer/wkt": "^2.2.1",
|
|
35
38
|
"@testing-library/dom": "^10.4.0",
|
|
36
39
|
"@testing-library/jest-dom": "^6.6.3",
|
|
@@ -56,7 +59,7 @@
|
|
|
56
59
|
"react-i18next": "^12.3.1",
|
|
57
60
|
"react-to-webcomponent": "^2.0.1",
|
|
58
61
|
"react-window": "^2.1.1",
|
|
59
|
-
"tailwindcss": "^
|
|
62
|
+
"tailwindcss": "^4.1.16",
|
|
60
63
|
"uuid": "^11.1.0",
|
|
61
64
|
"validate-iri": "^1.0.1",
|
|
62
65
|
"validator": "^13.15.0",
|
|
@@ -70,7 +73,6 @@
|
|
|
70
73
|
"build": "vite build",
|
|
71
74
|
"storybook": "storybook dev -p 6006",
|
|
72
75
|
"build-storybook": "storybook build",
|
|
73
|
-
"develop": "npm install --legacy-peer-deps && npm run update-dependencies && npm run start:elastic && vite && npm run stop:elastic",
|
|
74
76
|
"update-dependencies": "bash -x ./update-deps.sh",
|
|
75
77
|
"test": "./node_modules/.bin/vitest run",
|
|
76
78
|
"test:watch": "./node_modules/.bin/vitest watch",
|
|
@@ -108,7 +110,7 @@
|
|
|
108
110
|
"@storybook/react": "^8.6.12",
|
|
109
111
|
"@storybook/react-vite": "^8.6.12",
|
|
110
112
|
"@storybook/test": "^8.6.12",
|
|
111
|
-
"@tailwindcss/
|
|
113
|
+
"@tailwindcss/vite": "^4.1.16",
|
|
112
114
|
"@types/chance": "^1.1.6",
|
|
113
115
|
"@types/fs-extra": "^11.0.4",
|
|
114
116
|
"@types/terraformer__wkt": "^2.0.3",
|
|
@@ -126,7 +128,7 @@
|
|
|
126
128
|
"react-dom": "^18.2.0",
|
|
127
129
|
"storybook": "^8.6.12",
|
|
128
130
|
"typescript": "^5.4.3",
|
|
129
|
-
"vite": "^
|
|
131
|
+
"vite": "^6.0.0"
|
|
130
132
|
},
|
|
131
133
|
"peerDependencies": {
|
|
132
134
|
"react": "^18.0.0 || ^19.0.0",
|
package/postcss.config.cjs
CHANGED
|
@@ -221,13 +221,13 @@ const EmbeddedComponent: React.FC = () => {
|
|
|
221
221
|
return (
|
|
222
222
|
<div className="flex flex-row space-x-2 w-screen">
|
|
223
223
|
<div className="flex flex-col space-y-2 w-4/6">
|
|
224
|
-
<div className="flex flex-row
|
|
224
|
+
<div className="flex flex-row gap-x-2">
|
|
225
225
|
<Select
|
|
226
226
|
size='middle'
|
|
227
227
|
value={data.select.crate || undefined}
|
|
228
228
|
onChange={handleCrateChange}
|
|
229
229
|
placeholder="Select a crate"
|
|
230
|
-
style={{ width: '100%' }}
|
|
230
|
+
style={{ width: '100%', minWidth: '190px' }}
|
|
231
231
|
>
|
|
232
232
|
{data.crates.map((crate) => (
|
|
233
233
|
<Select.Option key={crate.name} value={crate.name}>
|
|
@@ -241,7 +241,7 @@ const EmbeddedComponent: React.FC = () => {
|
|
|
241
241
|
value={data.select.profile || undefined}
|
|
242
242
|
onChange={handleProfileChange}
|
|
243
243
|
placeholder="Select a profile"
|
|
244
|
-
style={{ width: '100%' }}
|
|
244
|
+
style={{ width: '100%', minWidth: '190px' }}
|
|
245
245
|
>
|
|
246
246
|
{data.profiles.map((profile) => (
|
|
247
247
|
<Select.Option key={profile.name} value={profile.name}>
|
|
@@ -18,7 +18,7 @@ export const ItemLink: React.FC<ItemLinkProps> = ({ entity, onLoadEntity, classN
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
|
-
<div className={`flex flex-col w-full ${className || ''}`} onClick={handleLoadEntity}>
|
|
21
|
+
<div className={`flex flex-col m-4 w-full ${className || ''}`} onClick={handleLoadEntity}>
|
|
22
22
|
<Typography.Text type="secondary" style={{ fontSize: '0.75rem' }} className="pb-1 mb-1 border-b border-black/20">
|
|
23
23
|
{decodeURIComponent(entity['@id'])}
|
|
24
24
|
</Typography.Text>
|
|
@@ -130,9 +130,9 @@ const RenderControls: React.FC<RenderControlsProps> = ({
|
|
|
130
130
|
};
|
|
131
131
|
|
|
132
132
|
return (
|
|
133
|
-
<Flex className="flex-row
|
|
133
|
+
<Flex className="flex-row gap-x-1">
|
|
134
134
|
{/* Navigation Controls */}
|
|
135
|
-
<Flex className="flex-row
|
|
135
|
+
<Flex className="flex-row gap-x-1">
|
|
136
136
|
<Button
|
|
137
137
|
onClick={handleBack}
|
|
138
138
|
type="primary"
|
|
@@ -81,7 +81,7 @@ const RenderLinkedItem: React.FC<RenderLinkedItemProps> = ({
|
|
|
81
81
|
<Flex className="describo-render-item-link py-1 rounded hover:rounded-r-none">
|
|
82
82
|
<Flex
|
|
83
83
|
vertical
|
|
84
|
-
style={{ margin: entity?.associations?.length ? 8 :
|
|
84
|
+
style={{ margin: entity?.associations?.length ? 8 : 2 }}
|
|
85
85
|
>
|
|
86
86
|
<Card
|
|
87
87
|
style={{
|
|
@@ -104,7 +104,7 @@ const RenderReverseConnections: React.FC<RenderReverseConnectionsProps> = ({
|
|
|
104
104
|
<Typography.Text className="text-lg mb-2">{t("links_to_this_entity")}</Typography.Text>
|
|
105
105
|
<div className="flex-grow" />
|
|
106
106
|
</div>
|
|
107
|
-
<div className="flex flex-col
|
|
107
|
+
<div className="flex flex-col gap-y-2">
|
|
108
108
|
<Pagination
|
|
109
109
|
current={currentPage}
|
|
110
110
|
total={connections.total}
|
|
@@ -131,7 +131,7 @@ const RenderReverseConnections: React.FC<RenderReverseConnectionsProps> = ({
|
|
|
131
131
|
hoverable
|
|
132
132
|
>
|
|
133
133
|
<Card.Meta
|
|
134
|
-
className="describo-render-item-link"
|
|
134
|
+
className="describo-render-item-link m-2"
|
|
135
135
|
title={
|
|
136
136
|
<RenderItemLink
|
|
137
137
|
entity={entity}
|
|
@@ -22,6 +22,12 @@ import isFunction from "lodash/isFunction";
|
|
|
22
22
|
import { CrateManagerType, ProfileManagerType, UnverifiedCrate } from "./types"; // Add appropriate types
|
|
23
23
|
import { propertyDefinitions } from "./property-definitions";
|
|
24
24
|
import { Lookup } from "./RenderEntity/auto-complete.lib";
|
|
25
|
+
import { App as AntApp, ConfigProvider } from 'antd';
|
|
26
|
+
import { createScopedCache } from './emotionCache';
|
|
27
|
+
import { CacheProvider } from "@emotion/react";
|
|
28
|
+
|
|
29
|
+
const antdCache = createScopedCache('recrate');
|
|
30
|
+
|
|
25
31
|
|
|
26
32
|
export interface DescriboCrateBuilderProps {
|
|
27
33
|
crate?: CrateManagerType["crate"];
|
|
@@ -300,23 +306,31 @@ export function DescriboCrateBuilder(props: DescriboCrateBuilderProps): JSX.Elem
|
|
|
300
306
|
};
|
|
301
307
|
|
|
302
308
|
return (
|
|
303
|
-
<
|
|
304
|
-
<
|
|
305
|
-
<
|
|
306
|
-
|
|
307
|
-
<
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
309
|
+
<div className="recrate">
|
|
310
|
+
<CacheProvider value={antdCache}>
|
|
311
|
+
<ConfigProvider>
|
|
312
|
+
<AntApp className="recrate-ant">
|
|
313
|
+
<ProfileManagerContext.Provider value={pm}>
|
|
314
|
+
<CrateManagerContext.Provider value={cm}>
|
|
315
|
+
<LookupsContext.Provider value={lookups}>
|
|
316
|
+
{ready && !error && contextEntity && (
|
|
317
|
+
<RenderEntity
|
|
318
|
+
ref={renderEntityRef}
|
|
319
|
+
entity={contextEntity}
|
|
320
|
+
onLoadEntity={handleSetCurrentEntity}
|
|
321
|
+
onSaveCrate={saveCrate}
|
|
322
|
+
onSaveEntityTemplate={saveEntityAsTemplate}
|
|
323
|
+
onWarning={handleWarning}
|
|
324
|
+
onError={handleError}
|
|
325
|
+
/>
|
|
326
|
+
)}
|
|
327
|
+
</LookupsContext.Provider>
|
|
328
|
+
</CrateManagerContext.Provider>
|
|
329
|
+
</ProfileManagerContext.Provider>
|
|
330
|
+
</AntApp>
|
|
331
|
+
</ConfigProvider>
|
|
332
|
+
</CacheProvider>
|
|
333
|
+
</div>
|
|
320
334
|
);
|
|
321
335
|
};
|
|
322
336
|
|
|
@@ -124,7 +124,7 @@ const NumberComponent: React.FC<NumberProps> = ({
|
|
|
124
124
|
|
|
125
125
|
return (
|
|
126
126
|
<div className="flex flex-col w-full describo-property-type-number">
|
|
127
|
-
<div className="flex flex-row
|
|
127
|
+
<div className="flex flex-row gap-x-2">
|
|
128
128
|
<Input
|
|
129
129
|
size='middle'
|
|
130
130
|
type="number"
|
|
@@ -82,19 +82,18 @@ const SelectComponent: React.FC<SelectProps> = ({
|
|
|
82
82
|
return (
|
|
83
83
|
<div className="flex flex-col w-full describo-property-type-select">
|
|
84
84
|
<Checkbox.Group
|
|
85
|
-
className="
|
|
85
|
+
className="flex flex-col gap-1"
|
|
86
86
|
value={isArray(internalValue) ? internalValue : []}
|
|
87
87
|
onChange={(checkedValues) => save(checkedValues as string[])}
|
|
88
88
|
>
|
|
89
89
|
{definition.values.map((value, idx) => (
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</Checkbox>
|
|
94
|
-
</div>
|
|
90
|
+
<Checkbox key={idx} value={value} className="block">
|
|
91
|
+
{value}
|
|
92
|
+
</Checkbox>
|
|
95
93
|
))}
|
|
96
94
|
</Checkbox.Group>
|
|
97
95
|
</div>
|
|
96
|
+
|
|
98
97
|
);
|
|
99
98
|
}
|
|
100
99
|
|
|
@@ -151,7 +151,7 @@ const Text: React.FC<TextProps> = ({
|
|
|
151
151
|
|
|
152
152
|
return (
|
|
153
153
|
<div className="flex flex-col w-full space-y-2 describo-property-type-text">
|
|
154
|
-
<div className="flex flex-row
|
|
154
|
+
<div className="flex flex-row gap-x-2">
|
|
155
155
|
{type !== 'textarea' ? (
|
|
156
156
|
<Input
|
|
157
157
|
size='middle'
|
|
@@ -46,7 +46,7 @@ const Url: React.FC<UrlProps> = ({
|
|
|
46
46
|
|
|
47
47
|
return (
|
|
48
48
|
<div className="flex flex-col describo-property-type-url">
|
|
49
|
-
<div className="flex flex-row flex-grow
|
|
49
|
+
<div className="flex flex-row flex-grow gap-x-2">
|
|
50
50
|
<Input
|
|
51
51
|
size='middle'
|
|
52
52
|
value={internalValue}
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import "./crate-builder/component.css";
|
|
2
2
|
import "./crate-builder/tailwind.css";
|
|
3
|
+
import "./crate-builder/recrate.css";
|
|
3
4
|
//import { DescriboCrateBuilder, DescriboCrateBuilderProps } from "./crate-builder/Shell";
|
|
4
5
|
|
|
5
6
|
//export default { DescriboCrateBuilder };
|
|
6
7
|
export type { JSONObject } from "./types";
|
|
8
|
+
export type { DescriboCrateBuilderProps } from "./types";
|
|
7
9
|
|
|
8
10
|
import { DescriboCrateBuilder } from "./crate-builder/Shell";
|
|
9
11
|
export { DescriboCrateBuilder };
|
package/tailwind.config.js
CHANGED
package/vite.config.ts
CHANGED
|
@@ -2,15 +2,17 @@ import { defineConfig } from 'vite';
|
|
|
2
2
|
import react from '@vitejs/plugin-react';
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
import dts from 'vite-plugin-dts';
|
|
5
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
5
6
|
|
|
6
7
|
export default defineConfig({
|
|
7
8
|
server: {
|
|
8
9
|
host: "0.0.0.0",
|
|
9
|
-
port:
|
|
10
|
+
port: 9000,
|
|
10
11
|
},
|
|
11
12
|
// For Describo
|
|
12
13
|
plugins: [
|
|
13
14
|
react(),
|
|
15
|
+
tailwindcss(),
|
|
14
16
|
dts({
|
|
15
17
|
include: ["src"],
|
|
16
18
|
insertTypesEntry: true, // <== important!
|
|
@@ -37,5 +39,8 @@ export default defineConfig({
|
|
|
37
39
|
}
|
|
38
40
|
},
|
|
39
41
|
},
|
|
42
|
+
css: {
|
|
43
|
+
postcss: './postcss.config.js',
|
|
44
|
+
}
|
|
40
45
|
|
|
41
46
|
})
|