Skip to content

Commit 92d438a

Browse files
committed
1.3.0
1 parent af74ce8 commit 92d438a

File tree

15 files changed

+3377
-26
lines changed

15 files changed

+3377
-26
lines changed

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ body:
66
attributes:
77
value: |
88
Please use a template below to create a minimal reproduction
9-
👉 https://codesandbox.io/p/sandbox/github/vueform/builder-sandbox/tree/main
9+
👉 https://stackblitz.com/github/vueform/builder-sandbox
1010
- type: textarea
1111
id: bug-env
1212
attributes:
@@ -19,7 +19,7 @@ body:
1919
id: reproduction
2020
attributes:
2121
label: Reproduction
22-
description: Please provide a link to a repo that can reproduce the problem you ran into. A [**minimal reproduction**](https://codesandbox.io/p/sandbox/github/vueform/builder-sandbox/tree/main) is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided we might close it.
22+
description: Please provide a link to a repo that can reproduce the problem you ran into. A [**minimal reproduction**](https://stackblitz.com/github/vueform/builder-sandbox) is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided we might close it.
2323
placeholder: Reproduction
2424
validations:
2525
required: true

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
[//]: # (Don't use <tags>)
22

3+
## v1.3.0
4+
5+
> `2024-03-19`
6+
7+
### 🎉 Feature
8+
- [Simple preset](https://builder.vueform.com/docs/presets#available-presets) added.
9+
- Allow `formatLoad` on config elements' schema.
10+
- Added `formDefaults`, `transformElement` and `names` options to config.
11+
- Element name increments now respect container element names.
12+
- Added placeholder for list/container elements.
13+
- All imports should now be proper modules.
14+
315
## v1.2.0
416

517
> `2024-02-19`

index.css

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,10 @@ input.vfb-clr-color:focus {
10521052
@apply absolute top-1.5 -right-0.5;
10531053
}
10541054

1055+
.vfb-util-props-group-container {
1056+
@apply col-span-12;
1057+
}
1058+
10551059
.vfb-util-props-group {
10561060
@apply my-4;
10571061
}
@@ -3331,6 +3335,12 @@ div > div:first-of-type[style*="none;"] + .vfb-util-props-separator-top {
33313335
--vf-container-bg-dynamic-3: rgb(255 0 244 / 15%);
33323336
--vf-container-bg-dynamic-4: rgb(255 0 0 / 20%);
33333337
--vf-container-bg-dynamic-5: rgb(0 0 0 / 12%);
3338+
--vf-container-text-neutral: rgb(149 161 170);
3339+
--vf-container-text-dynamic-1: rgb(91, 153, 168);
3340+
--vf-container-text-dynamic-2: rgb(99 115 180);
3341+
--vf-container-text-dynamic-3: rgb(139 86 137);
3342+
--vf-container-text-dynamic-4: rgb(154 13 13);
3343+
--vf-container-text-dynamic-5: rgb(0 0 0 / 54%);
33343344
}
33353345

33363346
.vfb-preview-wrapper-dark .vfb-preview-element-container-nested,
@@ -3341,35 +3351,47 @@ div > div:first-of-type[style*="none;"] + .vfb-util-props-separator-top {
33413351
--vf-container-bg-dynamic-3: rgb(0 255 12 / 20%);
33423352
--vf-container-bg-dynamic-4: rgb(0 3 255 / 20%);
33433353
--vf-container-bg-dynamic-5: rgb(0 0 0 / 20%);
3354+
--vf-container-text-neutral: rgb(255 255 255 / 100%);
3355+
--vf-container-text-dynamic-1: rgb(0 208 255 / 100%);
3356+
--vf-container-text-dynamic-2: rgb(2 215 130 / 100%);
3357+
--vf-container-text-dynamic-3: rgb(0 255 12 / 100%);
3358+
--vf-container-text-dynamic-4: rgb(0 3 255 / 100%);
3359+
--vf-container-text-dynamic-5: rgb(0 0 0 / 100%);
33443360
}
33453361

33463362
.vfb-preview-element-container-nested {
33473363
--vf-container-bg: var(--vf-container-bg-neutral);
3364+
--vf-container-text: var(--vf-container-text-neutral);
33483365
}
33493366

33503367
.vfb-preview-element-container-list,
33513368
.vfb-preview-element-container-list .vfb-preview-element-container-nested {
33523369
--vf-container-bg: var(--vf-container-bg-dynamic-1);
3370+
--vf-container-text: var(--vf-container-text-dynamic-1);
33533371
}
33543372

33553373
.vfb-preview-element-container-list .vfb-preview-element-container-list,
33563374
.vfb-preview-element-container-list .vfb-preview-element-container-list .vfb-preview-element-container-nested {
33573375
--vf-container-bg: var(--vf-container-bg-dynamic-2);
3376+
--vf-container-text: var(--vf-container-text-dynamic-2);
33583377
}
33593378

33603379
.vfb-preview-element-container-list .vfb-preview-element-container-list .vfb-preview-element-container-list,
33613380
.vfb-preview-element-container-list .vfb-preview-element-container-list .vfb-preview-element-container-list .vfb-preview-element-container-nested {
33623381
--vf-container-bg: var(--vf-container-bg-dynamic-3);
3382+
--vf-container-text: var(--vf-container-text-dynamic-3);
33633383
}
33643384

33653385
.vfb-preview-element-container-list .vfb-preview-element-container-list .vfb-preview-element-container-list .vfb-preview-element-container-list,
33663386
.vfb-preview-element-container-list .vfb-preview-element-container-list .vfb-preview-element-container-list .vfb-preview-element-container-list .vfb-preview-element-container-nested {
33673387
--vf-container-bg: var(--vf-container-bg-dynamic-4);
3388+
--vf-container-text: var(--vf-container-text-dynamic-4);
33683389
}
33693390

33703391
.vfb-preview-element-container-list .vfb-preview-element-container-list .vfb-preview-element-container-list .vfb-preview-element-container-list .vfb-preview-element-container-list,
33713392
.vfb-preview-element-container-list .vfb-preview-element-container-list .vfb-preview-element-container-list .vfb-preview-element-container-list .vfb-preview-element-container-list .vfb-preview-element-container-nested {
33723393
--vf-container-bg: var(--vf-container-bg-dynamic-5);
3394+
--vf-container-text: var(--vf-container-text-dynamic-5);
33733395
}
33743396

33753397
.vfb-preview-element-container-no-visual-nesting {
@@ -3588,4 +3610,13 @@ div > div:first-of-type[style*="none;"] + .vfb-util-props-separator-top {
35883610
}
35893611
.vfb-preview-wrapper-preview .vfb-preview-nested-list-element-wrapper {
35903612
@apply z-auto;
3613+
}
3614+
3615+
.vfb-drag-placeholder-container {
3616+
color: var(--vf-container-text);
3617+
@apply col-span-12 text-[32px] flex items-center justify-center flex-col my-3 text-center;
3618+
}
3619+
3620+
.vfb-drag-placeholder-text {
3621+
@apply text-base mt-2 leading-tight;
35913622
}

index.d.ts renamed to index.d.mts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ interface BuilderConfig {
6363
element?: ElementPanelConfig;
6464
elements?: string[];
6565
excludeElements?: string[];
66+
preset?: BuilderConfig;
67+
names?: boolean;
68+
transformElement?: boolean | function;
69+
formDefaults?: object;
6670
[key: string]: any;
6771
}
6872

index.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

index.mjs

Lines changed: 7 additions & 0 deletions
Large diffs are not rendered by default.

nuxt/src/module.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,25 @@ export default defineNuxtModule<ModuleOptions>({
2525

2626
nuxt.hook('prepare:types', (opts) => {
2727
opts.references.push({ types: '@vueform/vueform' })
28+
opts.references.push({ types: '@vueform/builder' })
2829
})
2930

3031
nuxt.options.build.transpile.push('@vueform/vueform')
3132
nuxt.options.build.transpile.push('@vueform/builder')
3233

33-
nuxt.options.vite.optimizeDeps = {
34-
...(nuxt.options.vite.optimizeDeps || {}),
35-
include: [
36-
...(nuxt.options.vite.optimizeDeps?.include || []),
37-
'wnumb',
38-
'nouislider',
39-
'trix',
40-
'lodash',
41-
'axios',
42-
'json5',
43-
'prismjs',
44-
]
45-
}
34+
// nuxt.options.vite.optimizeDeps = {
35+
// ...(nuxt.options.vite.optimizeDeps || {}),
36+
// include: [
37+
// ...(nuxt.options.vite.optimizeDeps?.include || []),
38+
// 'wnumb',
39+
// 'nouislider',
40+
// 'trix',
41+
// 'lodash',
42+
// 'axios',
43+
// 'json5',
44+
// 'prismjs',
45+
// ]
46+
// }
4647

4748
let configBase = resolve(
4849
nuxt.options.rootDir,

package.json

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": false,
33
"name": "@vueform/builder",
4-
"version": "1.2.0",
4+
"version": "1.3.0",
55
"description": "Vueform Builder development build.",
66
"homepage": "https://vueform.com",
77
"license": "SEE LICENSE IN LICENSE.txt",
@@ -11,8 +11,52 @@
1111
"email": "[email protected]"
1212
}
1313
],
14-
"main": "index.js",
14+
"sideEffects": false,
15+
"main": "index.mjs",
16+
"module": "index.mjs",
1517
"types": "index.d.ts",
18+
"exports": {
19+
".": {
20+
"types": "./index.d.mts",
21+
"default": "./index.mjs"
22+
},
23+
"./index": {
24+
"types": "./index.d.mts",
25+
"default": "./index.mjs"
26+
},
27+
"./index.js": {
28+
"types": "./index.d.mts",
29+
"default": "./index.mjs"
30+
},
31+
"./index.css": "./index.css",
32+
"./scss/*": "./scss/*",
33+
"./plugins/*": "./plugins/*",
34+
"./presets/simple": {
35+
"types": "./presets/simple.d.mts",
36+
"default": "./presets/simple.mjs"
37+
},
38+
"./plugins/elementSelector": "./plugins/elementSelector/index.mjs",
39+
"./plugins/elementSelector/index": "./plugins/elementSelector/index.mjs",
40+
"./plugins/elementSelector/index.js": "./plugins/elementSelector/index.mjs",
41+
"./plugin": {
42+
"types": "./plugin.d.mts",
43+
"default": "./plugin.mjs"
44+
},
45+
"./plugin.js": {
46+
"types": "./plugin.d.mts",
47+
"default": "./plugin.mjs"
48+
},
49+
"./tailwind": "./tailwind.js",
50+
"./tailwind.js": "./tailwind.js",
51+
"./vite": {
52+
"types": "./vite.d.mts",
53+
"default": "./vite.mjs"
54+
},
55+
"./vite.js": {
56+
"types": "./vite.d.mts",
57+
"default": "./vite.mjs"
58+
}
59+
},
1660
"dependencies": {
1761
"axios": "^1.5.0",
1862
"json5": "^2.2.3",
File renamed without changes.

plugin.js renamed to plugin.mjs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { onMounted, ref, computed, toRefs, watch, nextTick, inject, resolveComponent, } from 'vue'
2-
import elementSelectorPlugin from './plugins/elementSelector'
2+
import elementSelectorPlugin from './plugins/elementSelector/index.mjs'
33
import _ from 'lodash'
44

55
const asyncForEach = async (array, callback) => {
@@ -705,6 +705,11 @@ export default function () {
705705
type: Array,
706706
default: () => ([]),
707707
},
708+
builderConfig: {
709+
required: false,
710+
type: Object,
711+
default: () => ({}),
712+
},
708713
},
709714
setup(props, context, component) {
710715
const { pluginSettings, } = toRefs(props)
@@ -772,6 +777,7 @@ export default function () {
772777
if (excludeFields.value.indexOf(`${sectionName}.${fieldName}`) === -1) {
773778
fields.push(new field.type({
774779
...fieldOptions.value,
780+
extend: field.extend || {},
775781
loading: formLoading,
776782
emit: context.emit,
777783
icon,
@@ -802,6 +808,7 @@ export default function () {
802808

803809
let f = new field.type({
804810
...fieldOptions.value,
811+
extend: field.extend || {},
805812
loading: formLoading,
806813
emit: context.emit,
807814
icon,
@@ -886,7 +893,7 @@ export default function () {
886893
let target = section ? form.el$(section) : form
887894
let elements$ = section ? target.children$ : target.elements$.value
888895

889-
target.load(load)
896+
target.load(load, true)
890897

891898
Object.keys(elements$).forEach((elementName) => {
892899
let element$ = elements$[elementName]
@@ -1980,6 +1987,10 @@ export default function () {
19801987

19811988
// ============== COMPUTED ==============
19821989

1990+
const names = computed(() => {
1991+
return component.form$.value.builderConfig.names
1992+
})
1993+
19831994
const device = computed(() => {
19841995
return component.el$.value.form$.device || 'default'
19851996
})
@@ -2639,6 +2650,7 @@ export default function () {
26392650

26402651
return {
26412652
...component,
2653+
names,
26422654
ariaLabel,
26432655
editing,
26442656
resizing,
File renamed without changes.

presets/simple.d.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare module '@vueform/builder/presets/simple' {
2+
export default BuilderConfig;
3+
}

0 commit comments

Comments
 (0)