druxt-entity 0.22.0 → 0.23.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.
@@ -120,7 +120,7 @@ export default {
120
120
  if (!schema) return false
121
121
 
122
122
  const fields = {}
123
- for (const field of schema.fields) {
123
+ for (const field of schema.fields || []) {
124
124
  const relationship = !!((field.settings || {}).storage || {}).target_type || !!(model.relationships || {})[field.id]
125
125
  const value = relationship ? ((model || {}).relationships || {})[field.id] : ((model || {}).attributes || {})[field.id]
126
126
 
@@ -249,8 +249,24 @@ export default {
249
249
  * @returns {ComponentOptions}
250
250
  */
251
251
  componentOptions: ({ mode, schema, schemaType, type }) => ([
252
- [(schema || {}).resourceType || type, ((schema || {}).config || {}).mode || mode, ((schema || {}).config || {}).schemaType || schemaType || 'view'],
253
- [((schema || {}).config || {}).mode || mode],
252
+ // DruxtEntity[ResourceType][ViewMode][SchemaType]
253
+ [
254
+ (schema || {}).resourceType || type,
255
+ ((schema || {}).config || {}).mode || mode,
256
+ ((schema || {}).config || {}).schemaType || schemaType || 'view'
257
+ ],
258
+
259
+ // DruxtEntity[EntityType][ViewMode][SchemaType]
260
+ [
261
+ ((schema || {}).resourceType || type).split('--').shift(),
262
+ ((schema || {}).config || {}).mode || mode,
263
+ ((schema || {}).config || {}).schemaType || schemaType || 'view'
264
+ ],
265
+
266
+ // DruxtEntity[ViewMode]
267
+ [
268
+ ((schema || {}).config || {}).mode || mode,
269
+ ],
254
270
  ]),
255
271
 
256
272
  /**
@@ -369,17 +385,23 @@ export default {
369
385
  * @example @lang js
370
386
  * [
371
387
  * 'DruxtEntity[ResourceType][DisplayMode][SchemaType]',
388
+ * 'DruxtEntity[EntityType][DisplayMode][SchemaType]',
372
389
  * 'DruxtEntity[ResourceType][DisplayMode]',
390
+ * 'DruxtEntity[EntityType][DisplayMode]',
373
391
  * 'DruxtEntity[ResourceType]',
392
+ * 'DruxtEntity[EntityType]',
374
393
  * 'DruxtEntity[DisplayMode]',
375
394
  * ]
376
395
  *
377
396
  * @example <caption>Article Node (default)</caption> @lang js
378
397
  * [
379
398
  * 'DruxtEntityNodeArticleDefaultView',
399
+ * 'DruxtEntityNodeDefaultView',
380
400
  * 'DruxtEntityNodeArticleDefault',
381
- * 'DruxtEntityNodeArticle',
382
401
  * 'DruxtEntityNodeDefault',
402
+ * 'DruxtEntityNodeArticle',
403
+ * 'DruxtEntityNode',
404
+ * 'DruxtEntityDefault',
383
405
  * ]
384
406
  */
385
407
 
@@ -1,5 +1,8 @@
1
1
  <template>
2
- <DruxtEntity v-bind="route.props" />
2
+ <DruxtEntity
3
+ v-bind="route.props"
4
+ mode="full"
5
+ />
3
6
  </template>
4
7
 
5
8
  <script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "druxt-entity",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "description": "Drupal Display Mode powered Entity, Form and Field Druxt components.",
5
5
  "keywords": [
6
6
  "cms",
@@ -48,7 +48,7 @@
48
48
  "drupal-jsonapi-params": "^1.2.2",
49
49
  "druxt": "^0.16.0",
50
50
  "druxt-router": "^0.25.0",
51
- "druxt-schema": "^0.9.3"
51
+ "druxt-schema": "^0.10.0"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"
package/CHANGELOG.md DELETED
@@ -1,415 +0,0 @@
1
- # druxt-entity
2
-
3
- ## 0.22.0
4
-
5
- ### Minor Changes
6
-
7
- - 7b749bd: Updated DruxtEntityForm error handling.
8
-
9
- ### Patch Changes
10
-
11
- - Updated dependencies [7b749bd]
12
- - druxt@0.16.0
13
- - druxt-router@0.25.0
14
- - druxt-schema@0.9.3
15
-
16
- ## 0.21.4
17
-
18
- ### Patch Changes
19
-
20
- - Updated dependencies [2ae1d6d]
21
- - druxt@0.15.0
22
- - druxt-router@0.24.2
23
- - druxt-schema@0.9.2
24
-
25
- ## 0.21.3
26
-
27
- ### Patch Changes
28
-
29
- - Updated dependencies [45bc0b9]
30
- - druxt@0.14.0
31
- - druxt-router@0.24.1
32
- - druxt-schema@0.9.1
33
-
34
- ## 0.21.2
35
-
36
- ### Patch Changes
37
-
38
- - Updated dependencies [9161b38]
39
- - druxt-router@0.24.0
40
-
41
- ## 0.21.1
42
-
43
- ### Patch Changes
44
-
45
- - 6ade3a2: Fixed Vuex mutation error
46
-
47
- ## 0.21.0
48
-
49
- ### Minor Changes
50
-
51
- - 025315a: Added **include** option and the ability to filter related resources.
52
-
53
- ```js
54
- export default {
55
- druxt: {
56
- query: {
57
- include: ["field_media_image", "field_media_image.field_media_image"],
58
- fields: [
59
- ["file--file", ["uri"]],
60
- ["media--image", []]
61
- ]
62
- }
63
- }
64
- };
65
- ```
66
-
67
- - 025315a: Added **settings** property to the DruxtEntity and DruxtEntityForm components.
68
-
69
- ```vue
70
- <template>
71
- <DruxtEntity
72
- :settings="{ query: { include: ['uid'] } }"
73
- type="node--page"
74
- :uuid="uuid"
75
- />
76
- </template>
77
- ```
78
-
79
- - e7b1533: Refactored DruxtModule fetch hooks
80
-
81
- ### Patch Changes
82
-
83
- - Updated dependencies [77ab204]
84
- - druxt-schema@0.9.0
85
- - druxt@0.13.0
86
- - druxt-router@0.23.0
87
-
88
- ## 0.20.0
89
-
90
- ### Minor Changes
91
-
92
- - 897dcbc: Updated DruxtEntityForm to use new DruxtClient methods
93
-
94
- ### Patch Changes
95
-
96
- - Updated dependencies [4504a2f]
97
- - druxt@0.12.0
98
- - druxt-router@0.22.0
99
- - druxt-schema@0.8.1
100
-
101
- ## 0.19.0
102
-
103
- ### Minor Changes
104
-
105
- - dae345e: Added module level options
106
- - 8d28c18: Updated storybook integration
107
- - dae345e: Moved `$druxtEntity` plugin settings to `$druxt.settings.entity`
108
-
109
- ### Patch Changes
110
-
111
- - Updated dependencies [9d905e8]
112
- - druxt-router@0.21.0
113
- - druxt-schema@0.8.0
114
- - druxt@0.11.0
115
-
116
- ## 0.18.0
117
-
118
- ### Minor Changes
119
-
120
- - 715e5ef: Updated component registration method to use the Nuxt `components:dirs` hook
121
- - 2b8c3f3: Updated to use DruxtDebug component
122
-
123
- ### Patch Changes
124
-
125
- - 49454cb: Fixed path to components in Storybook
126
- - Updated dependencies [1ab762c]
127
- - druxt-router@0.20.0
128
- - druxt@0.10.0
129
- - druxt-schema@0.7.10
130
-
131
- ## 0.17.1
132
-
133
- ### Patch Changes
134
-
135
- - c4616df: Fixed dependencies
136
- - Updated dependencies [c4616df]
137
- - druxt-router@0.19.1
138
- - druxt-schema@0.7.9
139
-
140
- ## 0.17.0
141
-
142
- ### Minor Changes
143
-
144
- - 21170fb: Moved Vue components out of bundle
145
-
146
- ⚠ Potential breaking change
147
-
148
- _**Note:** This only effects custom Druxt modules and implementations._
149
-
150
- ```diff
151
- -import { DruxtEntity } from 'druxt-entity'
152
- +import DruxtEntity from 'druxt-entity/dist/components/DruxtEntity.vue'
153
- ```
154
-
155
- ### Patch Changes
156
-
157
- - Updated dependencies [21170fb]
158
- - druxt@0.9.0
159
- - druxt-router@0.19.0
160
- - druxt-schema@0.7.8
161
-
162
- ## 0.16.0
163
-
164
- ### Minor Changes
165
-
166
- - Added support for default template injection
167
-
168
- - For details, see the [Druxt 0.8.0 release notes](/api/packages/druxt/CHANGELOG#080)
169
-
170
- - Added support for schema-less entities
171
- - Added improved defaults to the DruxtField component
172
- - Deprecated DruxtField default field components
173
-
174
- The components can be tree shaken with the following setting in `nuxt.config.js`:
175
-
176
- ```js
177
- module.exports = {
178
- druxt: {
179
- entity: {
180
- components: {
181
- fields: false
182
- }
183
- }
184
- }
185
- };
186
- ```
187
-
188
- ## 0.15.0
189
-
190
- ### Minor Changes
191
-
192
- - Fixed issue with EntityReferenceLabel component
193
- - Added watch to update DeruxtEntity data on props change
194
- - Updated components v-model support
195
- - Updated Storybook integration
196
- - Updated dependencies
197
-
198
- ## 0.14.2
199
-
200
- ### Patch Changes
201
-
202
- - Updated fetchKey
203
-
204
- ## 0.14.1
205
-
206
- ### Patch Changes
207
-
208
- - Added custom fetchKey to fix hydration issues
209
-
210
- ## 0.14.0
211
-
212
- ### Minor Changes
213
-
214
- - Added v-model support for DruxtEntity/DruxtEntityForm components
215
-
216
- ```vue
217
- <template>
218
- <DruxtEntity v-model="entity" />
219
- <DruxtEntityForm v-model="entity" />
220
- </template>
221
- ```
222
-
223
- ## 0.13.0
224
-
225
- ### Minor Changes
226
-
227
- - Added DruxtEntityForm component
228
-
229
- ```vue
230
- <DruxtEntityForm type="node--page" @submit="onSubmit" @error="onError" />
231
- ```
232
-
233
- - For more details, refer to the [DruxtEntityForm API documentation](/api/packages/entity/components/DruxtEntityForm)
234
-
235
- ## 0.12.0
236
-
237
- ### Minor Changes
238
-
239
- - Added ability to filter JSON:API fields
240
- - Updated Storybook integration
241
-
242
- ## 0.11.2
243
-
244
- ### Patch Changes
245
-
246
- - Fixed issue with Storybook intergration
247
- - Updated Storybook integration
248
-
249
- ## 0.11.1
250
-
251
- ### Patch Changes
252
-
253
- - Fixed issue with Storybook intergration
254
-
255
- ## 0.11.0
256
-
257
- ### Minor Changes
258
-
259
- - Added DruxtEntity Storybook integration
260
- - Updated dependencies
261
-
262
- ## 0.10.1
263
-
264
- ### Patch Changes
265
-
266
- - Added TextSummaryOrTrimmed field
267
- - Added TextTrimmed field
268
- - Updated dependencies
269
-
270
- ## 0.10.0
271
-
272
- ### Minor Changes
273
-
274
- - Refactored module to use DruxtClient/DruxtStore
275
-
276
- ## 0.9.0
277
-
278
- ### Minor Changes
279
-
280
- - Added support for Entity reference view mode
281
- - Add ability to passthrough \$attrs
282
-
283
- ## 0.8.1
284
-
285
- ### Patch Changes
286
-
287
- - Updated dependencies
288
-
289
- ## 0.8.0
290
-
291
- ### Minor Changes
292
-
293
- - Added DruxtRouter Entity component
294
- - Updated dependencies
295
-
296
- ## 0.7.2
297
-
298
- ### Patch Changes
299
-
300
- - Updated dependencies
301
-
302
- ## 0.7.1
303
-
304
- ### Patch Changes
305
-
306
- - Updated DruxtEntity for DruxtComponentMixin
307
- - Updatd Field component mixins
308
- - Updated dependencies
309
-
310
- ## 0.7.0
311
-
312
- ### Minor Changes
313
-
314
- - Updated DruxtEntity for DruxtComponentMixin
315
-
316
- ## 0.6.3
317
-
318
- ### Patch Changes
319
-
320
- - Fixed issue with images and HMR
321
-
322
- ## 0.6.2
323
-
324
- ### Patch Changes
325
-
326
- - Fixed issue with `internal:` links
327
- - Updated dependencies
328
-
329
- ## 0.6.1
330
-
331
- ### Patch Changes
332
-
333
- - Updated dependencies
334
-
335
- ## 0.6.0
336
-
337
- ### Minor Changes
338
-
339
- - Refactored to use Nuxt fetch hook
340
-
341
- ## 0.5.2
342
-
343
- ### Patch Changes
344
-
345
- - Updated documentation
346
-
347
- ## 0.5.1
348
-
349
- ### Patch Changes
350
-
351
- - Added support for UUIDs in component suggestions
352
-
353
- ## 0.5.0
354
-
355
- ### Minor Changes
356
-
357
- - Added isEmpty method
358
- - Added FileDefault and Image fields
359
- - Added mode to EntityReferenceEntityView field
360
- - Added component suggestion system
361
- - Added context mixin
362
-
363
- ## 0.4.0
364
-
365
- ### Minor Changes
366
-
367
- - Update Field and label system
368
- - Updated Entity suggestions
369
-
370
- ## 0.3.1
371
-
372
- ### Patch Changes
373
-
374
- - Added named slots for fields
375
-
376
- ## 0.3.0
377
-
378
- ### Minor Changes
379
-
380
- - Added view mode suggestions
381
- - Added field id suggestions
382
-
383
- ## 0.2.2
384
-
385
- ### Patch Changes
386
-
387
- - Fixed issues with EntityReferenceLabel field
388
- - Updated NuberInteger field
389
-
390
- ## 0.2.1
391
-
392
- ### Patch Changes
393
-
394
- - Added BasicString field
395
- - Added Timestamp field
396
- - Fixed issue with ReferenceLabel field
397
- - Fixed empty field filter
398
-
399
- ## 0.2.0
400
-
401
- ### Minor Changes
402
-
403
- - Added better multivalue field support
404
- - Added ResponsiveImage field
405
- - Added EntityReferenceEntityView field
406
- - Added NumberInteger field
407
- - Added EntityReferenceRevisionsEntityView field
408
- - Added ListDefault field
409
- - Added Link field
410
- - Added DatetimeDefault field
411
- - Updated dependencies
412
-
413
- ## 0.1.0
414
-
415
- ### Initial release