@blokkli/editor 1.4.0-alpha.0 → 1.4.0-alpha.1
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/module.d.mts +71 -2
- package/dist/module.d.ts +71 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +293 -115
- package/dist/runtime/blokkliPlugins/AddAction/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/ItemAction/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/MenuButton/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue +1 -1
- package/dist/runtime/components/Blocks/Fragment/index.vue +7 -4
- package/dist/runtime/components/Blocks/FromLibrary/index.vue +8 -5
- package/dist/runtime/components/BlokkliField.vue +2 -2
- package/dist/runtime/components/BlokkliItem.vue +2 -2
- package/dist/runtime/components/Edit/Actions/index.vue +1 -1
- package/dist/runtime/components/Edit/AddListItem/index.vue +1 -1
- package/dist/runtime/components/Edit/AppMenu/index.vue +1 -1
- package/dist/runtime/components/Edit/BlockProxy/index.vue +3 -5
- package/dist/runtime/components/Edit/Dialog/index.vue +1 -1
- package/dist/runtime/components/Edit/DraggableList.vue +2 -2
- package/dist/runtime/components/Edit/EditIndicator.vue +2 -2
- package/dist/runtime/components/Edit/EditProvider.vue +3 -4
- package/dist/runtime/components/Edit/Features/Artboard/index.vue +9 -8
- package/dist/runtime/components/Edit/Features/BlockAddList/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Debug/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Diff/DiffView/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Edit/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/EditForm/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Fragments/Dialog/Item/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Fragments/Dialog/index.vue +38 -32
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/Item/index.vue +13 -6
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +65 -67
- package/dist/runtime/components/Edit/Features/Library/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/Item.vue +1 -1
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +3 -11
- package/dist/runtime/components/Edit/Features/MediaLibrary/types.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/Options/Form/index.vue +28 -3
- package/dist/runtime/components/Edit/Features/Options/index.vue +4 -1
- package/dist/runtime/components/Edit/Features/Publish/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/ResponsivePreview/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Settings/Dialog/FeatureSetting/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Settings/Dialog/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/Theme/Color/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Theme/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Translations/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/index.vue +1 -1
- package/dist/runtime/components/Edit/FormOverlay/Header/index.vue +1 -1
- package/dist/runtime/components/Edit/FormOverlay/index.vue +1 -1
- package/dist/runtime/components/Edit/Icon/index.vue +2 -2
- package/dist/runtime/components/Edit/ItemIcon/index.vue +1 -1
- package/dist/runtime/components/Edit/Pagination/index.vue +21 -0
- package/dist/runtime/components/Edit/PreviewProvider.vue +2 -2
- package/dist/runtime/components/Edit/ScaleToFit/index.vue +37 -6
- package/dist/runtime/components/Edit/index.d.ts +2 -1
- package/dist/runtime/components/Edit/index.js +3 -1
- package/dist/runtime/composables/defineBlokkli.d.ts +2 -2
- package/dist/runtime/composables/defineBlokkli.js +17 -22
- package/dist/runtime/composables/defineBlokkliFeature.d.ts +1 -1
- package/dist/runtime/composables/defineBlokkliFeature.js +1 -1
- package/dist/runtime/composables/defineBlokkliFragment.d.ts +1 -1
- package/dist/runtime/composables/defineBlokkliFragment.js +1 -1
- package/dist/runtime/css/output.css +1 -1
- package/dist/runtime/helpers/domProvider.js +1 -1
- package/dist/runtime/helpers/featuresProvider.d.ts +1 -1
- package/dist/runtime/helpers/featuresProvider.js +1 -1
- package/dist/runtime/helpers/index.d.ts +1 -0
- package/dist/runtime/helpers/index.js +7 -1
- package/dist/runtime/helpers/runtimeHelpers/index.d.ts +23 -2
- package/dist/runtime/helpers/runtimeHelpers/index.js +83 -10
- package/dist/runtime/helpers/storageProvider.js +1 -1
- package/dist/runtime/helpers/textProvider.js +2 -2
- package/dist/runtime/helpers/themeProvider.js +1 -1
- package/dist/runtime/types/index.d.ts +7 -4
- package/package.json +2 -2
- package/dist/runtime/helpers/options.d.ts +0 -2
- package/dist/runtime/helpers/options.js +0 -21
package/dist/module.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import { FeatureDefinition, BlockDefinitionOptionsInput } from '../dist/runtime/types/index.js';
|
|
2
|
+
import { FeatureDefinition, BlockDefinitionInput, BlockDefinitionOptionsInput } from '../dist/runtime/types/index.js';
|
|
3
3
|
import { AdapterMethods } from '../dist/runtime/adapter/index.js';
|
|
4
4
|
import { ThemeName, Theme } from '../dist/runtime/types/theme.js';
|
|
5
|
-
import { ModuleOptionsSettings } from '
|
|
5
|
+
import { ModuleOptionsSettings } from '../dist/runtime/types/generatedModuleTypes.js';
|
|
6
6
|
|
|
7
7
|
type ExtractedFeatureDefinition = {
|
|
8
8
|
id: string;
|
|
@@ -13,6 +13,25 @@ type ExtractedFeatureDefinition = {
|
|
|
13
13
|
source: string;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
+
type ExtractedBlockDefinitionInput = BlockDefinitionInput;
|
|
17
|
+
type ExtractedDefinition = {
|
|
18
|
+
filePath: string;
|
|
19
|
+
icon?: string;
|
|
20
|
+
chunkName: string;
|
|
21
|
+
componentName: string;
|
|
22
|
+
proxyComponent?: string;
|
|
23
|
+
diffComponent?: string;
|
|
24
|
+
definition: ExtractedBlockDefinitionInput;
|
|
25
|
+
source: string;
|
|
26
|
+
fileSource: string;
|
|
27
|
+
hasBlokkliField: boolean;
|
|
28
|
+
};
|
|
29
|
+
type GetBundlePropsTypeResult = {
|
|
30
|
+
typeName: string;
|
|
31
|
+
from: string;
|
|
32
|
+
};
|
|
33
|
+
type GetBundlePropsType = (name: string, definition: ExtractedDefinition) => GetBundlePropsTypeResult;
|
|
34
|
+
|
|
16
35
|
type AlterFeatures = {
|
|
17
36
|
features: ExtractedFeatureDefinition[];
|
|
18
37
|
};
|
|
@@ -123,6 +142,56 @@ type ModuleOptions = {
|
|
|
123
142
|
* bundles.
|
|
124
143
|
*/
|
|
125
144
|
storageDefaults?: ModuleOptionsStorageDefaults;
|
|
145
|
+
/**
|
|
146
|
+
* Method that is called for each block bundle component to generate the
|
|
147
|
+
* prop types.
|
|
148
|
+
*
|
|
149
|
+
* These types are used if you access a block item with the generated
|
|
150
|
+
* FieldListItemTyped type, for example through:
|
|
151
|
+
* const { rootBlocks } = defineBlokkli().
|
|
152
|
+
*
|
|
153
|
+
* or using <BlokkliField v-slot="{ items }">.
|
|
154
|
+
*
|
|
155
|
+
* The method receives the name of the bundle and the extracted block
|
|
156
|
+
* definition as the second argument.
|
|
157
|
+
* The return value should be an object with these properties:
|
|
158
|
+
*
|
|
159
|
+
* - typeName: The name of the type
|
|
160
|
+
* - from: Where the type can be imported from
|
|
161
|
+
*
|
|
162
|
+
* For example, if the method returns this object:
|
|
163
|
+
* ```typescript
|
|
164
|
+
* {
|
|
165
|
+
* typeName: 'ParagraphTextWithImageFragment',
|
|
166
|
+
* from: '#graphql-operations'
|
|
167
|
+
* }
|
|
168
|
+
* ```
|
|
169
|
+
*
|
|
170
|
+
* Then the module will generate this TypeScript code:
|
|
171
|
+
*
|
|
172
|
+
* ```typescript
|
|
173
|
+
* import type { ParagraphTextWithImageFragment } from '#graphql-operations'
|
|
174
|
+
* ```
|
|
175
|
+
*
|
|
176
|
+
* And assign the imported type as the type for the `props` property for this bundle.
|
|
177
|
+
*
|
|
178
|
+
* Then, for example in a block component:
|
|
179
|
+
*
|
|
180
|
+
* ```typescript
|
|
181
|
+
* const { siblings, index } = defineBlokkli()
|
|
182
|
+
*
|
|
183
|
+
* const previousBlock = computed(() => siblings.value[index.value - 1])
|
|
184
|
+
*
|
|
185
|
+
* const previousTitle = computed(() => {
|
|
186
|
+
* // The previous block in the list is a title.
|
|
187
|
+
* if (previousBlock.value?.bundle === 'title') {
|
|
188
|
+
* // The type of the props are now typed correctly.
|
|
189
|
+
* const title = previousBlock.value.props.title
|
|
190
|
+
* }
|
|
191
|
+
* })
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
getBundlePropsType?: GetBundlePropsType;
|
|
126
195
|
};
|
|
127
196
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
128
197
|
|
package/dist/module.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import { FeatureDefinition, BlockDefinitionOptionsInput } from '../dist/runtime/types/index.js';
|
|
2
|
+
import { FeatureDefinition, BlockDefinitionInput, BlockDefinitionOptionsInput } from '../dist/runtime/types/index.js';
|
|
3
3
|
import { AdapterMethods } from '../dist/runtime/adapter/index.js';
|
|
4
4
|
import { ThemeName, Theme } from '../dist/runtime/types/theme.js';
|
|
5
|
-
import { ModuleOptionsSettings } from '
|
|
5
|
+
import { ModuleOptionsSettings } from '../dist/runtime/types/generatedModuleTypes.js';
|
|
6
6
|
|
|
7
7
|
type ExtractedFeatureDefinition = {
|
|
8
8
|
id: string;
|
|
@@ -13,6 +13,25 @@ type ExtractedFeatureDefinition = {
|
|
|
13
13
|
source: string;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
+
type ExtractedBlockDefinitionInput = BlockDefinitionInput;
|
|
17
|
+
type ExtractedDefinition = {
|
|
18
|
+
filePath: string;
|
|
19
|
+
icon?: string;
|
|
20
|
+
chunkName: string;
|
|
21
|
+
componentName: string;
|
|
22
|
+
proxyComponent?: string;
|
|
23
|
+
diffComponent?: string;
|
|
24
|
+
definition: ExtractedBlockDefinitionInput;
|
|
25
|
+
source: string;
|
|
26
|
+
fileSource: string;
|
|
27
|
+
hasBlokkliField: boolean;
|
|
28
|
+
};
|
|
29
|
+
type GetBundlePropsTypeResult = {
|
|
30
|
+
typeName: string;
|
|
31
|
+
from: string;
|
|
32
|
+
};
|
|
33
|
+
type GetBundlePropsType = (name: string, definition: ExtractedDefinition) => GetBundlePropsTypeResult;
|
|
34
|
+
|
|
16
35
|
type AlterFeatures = {
|
|
17
36
|
features: ExtractedFeatureDefinition[];
|
|
18
37
|
};
|
|
@@ -123,6 +142,56 @@ type ModuleOptions = {
|
|
|
123
142
|
* bundles.
|
|
124
143
|
*/
|
|
125
144
|
storageDefaults?: ModuleOptionsStorageDefaults;
|
|
145
|
+
/**
|
|
146
|
+
* Method that is called for each block bundle component to generate the
|
|
147
|
+
* prop types.
|
|
148
|
+
*
|
|
149
|
+
* These types are used if you access a block item with the generated
|
|
150
|
+
* FieldListItemTyped type, for example through:
|
|
151
|
+
* const { rootBlocks } = defineBlokkli().
|
|
152
|
+
*
|
|
153
|
+
* or using <BlokkliField v-slot="{ items }">.
|
|
154
|
+
*
|
|
155
|
+
* The method receives the name of the bundle and the extracted block
|
|
156
|
+
* definition as the second argument.
|
|
157
|
+
* The return value should be an object with these properties:
|
|
158
|
+
*
|
|
159
|
+
* - typeName: The name of the type
|
|
160
|
+
* - from: Where the type can be imported from
|
|
161
|
+
*
|
|
162
|
+
* For example, if the method returns this object:
|
|
163
|
+
* ```typescript
|
|
164
|
+
* {
|
|
165
|
+
* typeName: 'ParagraphTextWithImageFragment',
|
|
166
|
+
* from: '#graphql-operations'
|
|
167
|
+
* }
|
|
168
|
+
* ```
|
|
169
|
+
*
|
|
170
|
+
* Then the module will generate this TypeScript code:
|
|
171
|
+
*
|
|
172
|
+
* ```typescript
|
|
173
|
+
* import type { ParagraphTextWithImageFragment } from '#graphql-operations'
|
|
174
|
+
* ```
|
|
175
|
+
*
|
|
176
|
+
* And assign the imported type as the type for the `props` property for this bundle.
|
|
177
|
+
*
|
|
178
|
+
* Then, for example in a block component:
|
|
179
|
+
*
|
|
180
|
+
* ```typescript
|
|
181
|
+
* const { siblings, index } = defineBlokkli()
|
|
182
|
+
*
|
|
183
|
+
* const previousBlock = computed(() => siblings.value[index.value - 1])
|
|
184
|
+
*
|
|
185
|
+
* const previousTitle = computed(() => {
|
|
186
|
+
* // The previous block in the list is a title.
|
|
187
|
+
* if (previousBlock.value?.bundle === 'title') {
|
|
188
|
+
* // The type of the props are now typed correctly.
|
|
189
|
+
* const title = previousBlock.value.props.title
|
|
190
|
+
* }
|
|
191
|
+
* })
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
getBundlePropsType?: GetBundlePropsType;
|
|
126
195
|
};
|
|
127
196
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
128
197
|
|