@plan2net/typo3-playwright-toolkit 0.4.2 → 0.6.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.
- package/README.md +110 -14
- package/dist/builders/content-builder.d.ts +9 -1
- package/dist/builders/content-builder.d.ts.map +1 -1
- package/dist/builders/content-builder.js +64 -7
- package/dist/builders/content-builder.js.map +1 -1
- package/dist/builders/core-content.d.ts +46 -13
- package/dist/builders/core-content.d.ts.map +1 -1
- package/dist/builders/core-content.js +47 -50
- package/dist/builders/core-content.js.map +1 -1
- package/dist/builders/fields.d.ts +26 -4
- package/dist/builders/fields.d.ts.map +1 -1
- package/dist/builders/fields.js +35 -8
- package/dist/builders/fields.js.map +1 -1
- package/dist/builders/identifier.d.ts.map +1 -1
- package/dist/builders/identifier.js +1 -4
- package/dist/builders/identifier.js.map +1 -1
- package/dist/builders/page-builder.d.ts +14 -2
- package/dist/builders/page-builder.d.ts.map +1 -1
- package/dist/builders/page-builder.js +17 -4
- package/dist/builders/page-builder.js.map +1 -1
- package/dist/builders/relations.d.ts +41 -0
- package/dist/builders/relations.d.ts.map +1 -0
- package/dist/builders/relations.js +130 -0
- package/dist/builders/relations.js.map +1 -0
- package/dist/http/record-edit.js +13 -4
- package/dist/http/record-edit.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/playwright/base-config.d.ts +17 -1
- package/dist/playwright/base-config.d.ts.map +1 -1
- package/dist/playwright/base-config.js +31 -5
- package/dist/playwright/base-config.js.map +1 -1
- package/dist/playwright/index.d.ts +1 -1
- package/dist/playwright/index.d.ts.map +1 -1
- package/dist/playwright/index.js.map +1 -1
- package/dist/scenario.d.ts +2 -0
- package/dist/scenario.d.ts.map +1 -1
- package/dist/scenario.js +16 -0
- package/dist/scenario.js.map +1 -1
- package/dist/types/common.d.ts +4 -0
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/content-builder.d.ts +5 -2
- package/dist/types/content-builder.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,9 +47,10 @@ Add a `tsconfig.json` next to your tests that extends the one shipped here:
|
|
|
47
47
|
}
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
> [!IMPORTANT]
|
|
51
|
+
> This package is ESM and needs `"moduleResolution": "NodeNext"`. Without it
|
|
52
|
+
> TypeScript cannot read the package's exports, so `page` and `state` in your tests
|
|
53
|
+
> type as `any` and you lose every check your editor could give you.
|
|
53
54
|
|
|
54
55
|
## Configure
|
|
55
56
|
|
|
@@ -82,8 +83,9 @@ directory is not an error: the run works and writes its state somewhere you did
|
|
|
82
83
|
expect. Use `fileURLToPath` rather than `new URL(...).pathname`, which
|
|
83
84
|
percent-encodes a project path containing spaces or non-ASCII characters.
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
> [!IMPORTANT]
|
|
87
|
+
> `defineToolkitConfig` must run before the first import from this package.
|
|
88
|
+
> Everything else reads the values it stores.
|
|
87
89
|
|
|
88
90
|
## Using the package
|
|
89
91
|
|
|
@@ -94,7 +96,7 @@ TYPO3 backend, and the tests that read it.
|
|
|
94
96
|
|
|
95
97
|
```ts
|
|
96
98
|
// tests/my-feature.spec.ts
|
|
97
|
-
import { defineScenario, expect } from '@plan2net/typo3-playwright-toolkit'
|
|
99
|
+
import { defineScenario, expect, flexForm } from '@plan2net/typo3-playwright-toolkit'
|
|
98
100
|
|
|
99
101
|
const test = defineScenario(async ({ builders }) => {
|
|
100
102
|
const { id, slug } = await builders
|
|
@@ -110,6 +112,16 @@ const test = defineScenario(async ({ builders }) => {
|
|
|
110
112
|
.configure((element) => element.withHeader('Hello').withBodyText('<p>Copy.</p>'))
|
|
111
113
|
.create()
|
|
112
114
|
|
|
115
|
+
await builders
|
|
116
|
+
.content()
|
|
117
|
+
.onPage(id)
|
|
118
|
+
// your own CType, registered as shown under "Your own content types"
|
|
119
|
+
.ofType('article')
|
|
120
|
+
.configure((element) =>
|
|
121
|
+
element.withField('pi_flexform', flexForm({ 'settings.limit': 3 })),
|
|
122
|
+
)
|
|
123
|
+
.create()
|
|
124
|
+
|
|
113
125
|
return { slug }
|
|
114
126
|
})
|
|
115
127
|
|
|
@@ -199,6 +211,50 @@ A key with the name of a core CType replaces the built-in builder, and the other
|
|
|
199
211
|
core types stay as they are. That works for the type too: `ContentTypeMap` starts
|
|
200
212
|
empty, so your `text: MyTextContent` is what `.configure()` hands you.
|
|
201
213
|
|
|
214
|
+
### Files and child records
|
|
215
|
+
|
|
216
|
+
Four setters attach a relation, and they work the same on a content type, on a
|
|
217
|
+
child record, and on the builder in a test:
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
export class AccordionContent extends CoreContent {
|
|
221
|
+
readonly type = 'accordion'
|
|
222
|
+
|
|
223
|
+
withItems(items: AccordionItem[]): this {
|
|
224
|
+
return this.withChildren('items', 'tx_myext_accordion_item', items, (item, data) =>
|
|
225
|
+
item
|
|
226
|
+
.withField('title', data.title)
|
|
227
|
+
.withFileReference('image', data.imageId),
|
|
228
|
+
)
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
`withFileReference(column, fileUid)` and `withFileReferences(column, fileUids)` take
|
|
234
|
+
the reference's own fields as a third argument, such as a `crop`. `withChild` and
|
|
235
|
+
`withChildren` hand the callback a record with the same four setters, so a child can
|
|
236
|
+
carry its own files and children.
|
|
237
|
+
|
|
238
|
+
The order you call them in is the order the records get. A child takes `pid` and
|
|
239
|
+
`sys_language_uid` from the record above it, so a translation sets the language once,
|
|
240
|
+
at the top.
|
|
241
|
+
|
|
242
|
+
Never set `uid_local`, `uid_foreign`, `tablenames`, `fieldname` or `sorting_foreign`:
|
|
243
|
+
the toolkit writes them, and your own value fails. A wrong `uid_foreign` saves a row
|
|
244
|
+
that points at nothing, and TYPO3 reports no error.
|
|
245
|
+
|
|
246
|
+
If a builder has no setter for a column, add the relation in the test:
|
|
247
|
+
|
|
248
|
+
```ts
|
|
249
|
+
await builders.content().onPage(page.id).ofType('textmedia')
|
|
250
|
+
.configure((element) => element.withHeader('Gallery', 'h2'))
|
|
251
|
+
.withFileReferences('assets', [1, 2], { crop: imageCrop({ ratio: '16:9' }) })
|
|
252
|
+
.create()
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Fill a column from one place only. Both the content type and the test, or `withField`
|
|
256
|
+
on top, fails.
|
|
257
|
+
|
|
202
258
|
### Calling the site directly
|
|
203
259
|
|
|
204
260
|
The `request` client — the one `defineScenario` hands your setup, and the `request`
|
|
@@ -261,8 +317,9 @@ await runAccessibilityScan(page, { exclude: '#ads' })
|
|
|
261
317
|
await runAccessibilityScan(page, { disabledRules: ['color-contrast'] })
|
|
262
318
|
```
|
|
263
319
|
|
|
264
|
-
|
|
265
|
-
|
|
320
|
+
> [!IMPORTANT]
|
|
321
|
+
> The test also fails when the check ran no rules at all. An empty area would
|
|
322
|
+
> otherwise pass without testing anything.
|
|
266
323
|
|
|
267
324
|
A check with `include` turns off the `heading-order` rule, because axe compares the
|
|
268
325
|
headings of a part of the page with the structure of the whole page. Checks of a
|
|
@@ -297,8 +354,9 @@ await page.goto('/')
|
|
|
297
354
|
await verifier.assertNoViolations(testInfo) // testInfo is optional
|
|
298
355
|
```
|
|
299
356
|
|
|
300
|
-
|
|
301
|
-
|
|
357
|
+
> [!IMPORTANT]
|
|
358
|
+
> `install()` must run before anything is loaded. A page that is already open
|
|
359
|
+
> reports nothing.
|
|
302
360
|
|
|
303
361
|
The test also fails if pages were requested but none of your own pages ever arrived,
|
|
304
362
|
so a navigation that never loaded cannot pass. Pass `testInfo` to attach the full
|
|
@@ -343,7 +401,12 @@ Everything else:
|
|
|
343
401
|
|
|
344
402
|
`defineBasePlaywrightConfig` sets Playwright's `baseURL` to `testingURL` and adds
|
|
345
403
|
this package's setup and cleanup functions. Values in its second argument win, and
|
|
346
|
-
`use` and `expect` are merged instead of replaced.
|
|
404
|
+
`use` and `expect` are merged instead of replaced. Four keys cannot be overridden
|
|
405
|
+
and are refused with an error: `globalSetup` and `globalTeardown` carry the
|
|
406
|
+
preflight and the database cleanup, `use.baseURL` must stay the testing origin, and
|
|
407
|
+
`use.serviceWorkers` stays `block` because a service worker serves past the routing
|
|
408
|
+
that carries the test ID. Add your own setup as a Playwright project dependency
|
|
409
|
+
instead.
|
|
347
410
|
|
|
348
411
|
### Content types
|
|
349
412
|
|
|
@@ -353,9 +416,42 @@ Every CType of a normal TYPO3 installation has a builder, and you register nothi
|
|
|
353
416
|
|
|
354
417
|
All builders share `withHeader`, `withSubheader`, `withHeaderLayout`,
|
|
355
418
|
`withHeaderLink`, `withColPos`, `setHidden`, and `withField(column, value)` for any
|
|
356
|
-
other TCA column.
|
|
357
|
-
`
|
|
358
|
-
`
|
|
419
|
+
other TCA column. They also share the four relation setters above —
|
|
420
|
+
`withFileReference`, `withFileReferences`, `withChild` and `withChildren`. Types with
|
|
421
|
+
images add `withFile` and `withFiles` for their own media column, plus `withColumns`,
|
|
422
|
+
`withOrientation` and `withImageSize`.
|
|
423
|
+
|
|
424
|
+
Where core stores a number that means nothing on its own, the setter takes the name
|
|
425
|
+
and your editor suggests the options:
|
|
426
|
+
|
|
427
|
+
```ts
|
|
428
|
+
element.withHeader('Chapter', 'h3') // header_layout 3, or 'hidden' for 100
|
|
429
|
+
element.withBulletsType('numbers') // bullets_type 1
|
|
430
|
+
element.withHeaderPosition('top') // table_header_position 1
|
|
431
|
+
element.withOrientation('in-text-right') // imageorient 17
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
`PageBuilder` does the same for the page type: `withDoktype('folder')` writes 254.
|
|
435
|
+
It also takes a number, for a doktype your own project registered.
|
|
436
|
+
|
|
437
|
+
The `crop` column of a file reference holds JSON text, which `imageCrop()` writes for
|
|
438
|
+
you. Without an area it keeps the whole image, which is what naming only a ratio
|
|
439
|
+
means:
|
|
440
|
+
|
|
441
|
+
```ts
|
|
442
|
+
imageCrop({ ratio: '16:9' })
|
|
443
|
+
imageCrop({ area: { x: 0.1, y: 0, width: 0.5, height: 1 } })
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
A flexform column takes `flexForm()`, because the form posts one field per value
|
|
447
|
+
rather than one for the column:
|
|
448
|
+
|
|
449
|
+
```ts
|
|
450
|
+
element.withField('pi_flexform', flexForm({ 'settings.limit': 10 }))
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
Plain values land on the single sheet a structure without named ones has. Where it
|
|
454
|
+
has several, name one per group: `flexForm({ sDEF: {…}, sFilter: {…} })`.
|
|
359
455
|
|
|
360
456
|
### The inspect command
|
|
361
457
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Page } from '@playwright/test';
|
|
2
|
-
import { ContentBuilderInterface } from '../types/content-builder.js';
|
|
2
|
+
import { ContentBuilderInterface, type ContentFields } from '../types/content-builder.js';
|
|
3
3
|
import type { ContentTypeFor, ContentTypeKey } from './core-content.js';
|
|
4
|
+
import { type ChildRecord } from './relations.js';
|
|
4
5
|
import { type RequestContext } from './request-context.js';
|
|
5
6
|
export declare class ContentBuilder {
|
|
6
7
|
private page;
|
|
@@ -20,8 +21,15 @@ declare class TypedContentBuilder<B extends ContentBuilderInterface = ContentBui
|
|
|
20
21
|
private pageId;
|
|
21
22
|
private requestContext?;
|
|
22
23
|
private builder;
|
|
24
|
+
private readonly fields;
|
|
25
|
+
private readonly relations;
|
|
23
26
|
constructor(page: Page, pageId: string, type: string, requestContext?: Partial<RequestContext> | undefined);
|
|
24
27
|
configure(fn: (builder: B) => void): this;
|
|
28
|
+
withField(column: string, value: ContentFields[string]): this;
|
|
29
|
+
withFileReference(column: string, fileUid: number, fields?: ContentFields): this;
|
|
30
|
+
withFileReferences(column: string, fileUids: number[], fields?: ContentFields): this;
|
|
31
|
+
withChild(column: string, table: string, configure: (child: ChildRecord) => void): this;
|
|
32
|
+
withChildren<T>(column: string, table: string, items: T[], configure: (child: ChildRecord, item: T) => void): this;
|
|
25
33
|
create(): Promise<{
|
|
26
34
|
id: string;
|
|
27
35
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-builder.d.ts","sourceRoot":"","sources":["../../src/builders/content-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"content-builder.d.ts","sourceRoot":"","sources":["../../src/builders/content-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,uBAAuB,EAAE,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAEzF,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvE,OAAO,EAA6B,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5E,OAAO,EAAyC,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAKjG,qBAAa,cAAc;IACvB,OAAO,CAAC,IAAI,CAAM;IAClB,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAyB;gBAE7C,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC;IAKhE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAK5B;;;OAGG;IACH,MAAM,CAAC,CAAC,SAAS,cAAc,EAAE,IAAI,EAAE,CAAC,GAAG,mBAAmB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IACjF,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAAC,uBAAuB,CAAC;CAWrE;AAED,cAAM,mBAAmB,CAAC,CAAC,SAAS,uBAAuB,GAAG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|
3
|
+
import { mergeRecords, RelationSet } from './relations.js';
|
|
4
|
+
import { toColumnValues } from './fields.js';
|
|
4
5
|
import { replayParentId, resolveRequestContext } from './request-context.js';
|
|
5
6
|
import { newRecordIdentifier } from './identifier.js';
|
|
7
|
+
const lastElementOnPage = new WeakMap();
|
|
6
8
|
export class ContentBuilder {
|
|
7
9
|
page;
|
|
8
10
|
pageId = '';
|
|
@@ -28,6 +30,8 @@ class TypedContentBuilder {
|
|
|
28
30
|
pageId;
|
|
29
31
|
requestContext;
|
|
30
32
|
builder;
|
|
33
|
+
fields = {};
|
|
34
|
+
relations = new RelationSet('tt_content', (column) => column in this.fields);
|
|
31
35
|
constructor(page, pageId, type, requestContext) {
|
|
32
36
|
this.page = page;
|
|
33
37
|
this.pageId = pageId;
|
|
@@ -38,6 +42,26 @@ class TypedContentBuilder {
|
|
|
38
42
|
fn(this.builder);
|
|
39
43
|
return this;
|
|
40
44
|
}
|
|
45
|
+
withField(column, value) {
|
|
46
|
+
this.fields[column] = value;
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
withFileReference(column, fileUid, fields = {}) {
|
|
50
|
+
this.relations.withFileReference(column, fileUid, fields);
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
withFileReferences(column, fileUids, fields = {}) {
|
|
54
|
+
this.relations.withFileReferences(column, fileUids, fields);
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
withChild(column, table, configure) {
|
|
58
|
+
this.relations.withChild(column, table, configure);
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
withChildren(column, table, items, configure) {
|
|
62
|
+
this.relations.withChildren(column, table, items, configure);
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
41
65
|
async create() {
|
|
42
66
|
const context = resolveRequestContext(this.page, this.requestContext);
|
|
43
67
|
const identifier = newRecordIdentifier();
|
|
@@ -46,23 +70,56 @@ class TypedContentBuilder {
|
|
|
46
70
|
// CType and colPos are set below; an empty string means "the type did not
|
|
47
71
|
// set it".
|
|
48
72
|
const own = Object.fromEntries(Object.entries(fields).filter(([column, value]) => value !== '' && !['CType', 'colPos'].includes(column)));
|
|
73
|
+
const columnValues = toColumnValues({ ...own, ...this.fields });
|
|
74
|
+
// Not the record's own pid, which carries the -uid positioning the element.
|
|
75
|
+
const owner = {
|
|
76
|
+
pid: columnValues.pid ?? pageId,
|
|
77
|
+
sys_language_uid: columnValues.sys_language_uid ?? 0,
|
|
78
|
+
};
|
|
79
|
+
const inner = this.builder.getRelations?.(owner) ?? { columns: {}, records: {} };
|
|
80
|
+
const outer = this.relations.materialise(owner);
|
|
81
|
+
refuseSharedColumns(inner.columns, outer.columns);
|
|
49
82
|
const record = {
|
|
50
|
-
pid: pageId,
|
|
83
|
+
pid: insertPosition(this.page, pageId),
|
|
51
84
|
sys_language_uid: 0,
|
|
52
85
|
CType: fields.CType || this.builder.type,
|
|
53
86
|
colPos: fields.colPos ?? 0,
|
|
54
|
-
...
|
|
87
|
+
...columnValues,
|
|
88
|
+
...inner.columns,
|
|
89
|
+
...outer.columns,
|
|
55
90
|
};
|
|
91
|
+
// Merged per table, not spread: a child table may be tt_content itself.
|
|
92
|
+
const data = { tt_content: { [identifier]: record } };
|
|
93
|
+
mergeRecords(data, this.builder.getAdditionalRecords?.(identifier, pageId) ?? {});
|
|
94
|
+
mergeRecords(data, inner.records);
|
|
95
|
+
mergeRecords(data, outer.records);
|
|
56
96
|
const uid = await saveRecord(this.page.request, context, {
|
|
57
97
|
table: 'tt_content',
|
|
58
98
|
identifier: identifier,
|
|
59
99
|
target: Number(pageId),
|
|
60
|
-
data
|
|
61
|
-
tt_content: { [identifier]: record },
|
|
62
|
-
...(this.builder.getAdditionalRecords?.(identifier, pageId) ?? {}),
|
|
63
|
-
},
|
|
100
|
+
data,
|
|
64
101
|
});
|
|
102
|
+
lastElementOnPage.get(this.page)?.set(pageId, uid);
|
|
65
103
|
return { id: String(uid) };
|
|
66
104
|
}
|
|
67
105
|
}
|
|
106
|
+
function refuseSharedColumns(inner, outer) {
|
|
107
|
+
const shared = Object.keys(outer).filter((column) => column in inner);
|
|
108
|
+
if (shared.length > 0) {
|
|
109
|
+
throw new Error(`[typo3-playwright-toolkit] The column ${shared.join(' and ')} is filled twice — ` +
|
|
110
|
+
'once inside configure() and once on the builder. Nothing decides which of ' +
|
|
111
|
+
'the two comes first, so the records would end up in a random order. Put ' +
|
|
112
|
+
'them all in one place.');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/** Keyed by the page: `builders.content()` hands out a fresh builder per call. */
|
|
116
|
+
function insertPosition(page, pageId) {
|
|
117
|
+
let created = lastElementOnPage.get(page);
|
|
118
|
+
if (undefined === created) {
|
|
119
|
+
created = new Map();
|
|
120
|
+
lastElementOnPage.set(page, created);
|
|
121
|
+
}
|
|
122
|
+
const previous = created.get(pageId);
|
|
123
|
+
return undefined === previous ? pageId : `-${previous}`;
|
|
124
|
+
}
|
|
68
125
|
//# sourceMappingURL=content-builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-builder.js","sourceRoot":"","sources":["../../src/builders/content-builder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"content-builder.js","sourceRoot":"","sources":["../../src/builders/content-builder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,OAAO,EAAE,UAAU,EAAsB,MAAM,wBAAwB,CAAA;AACvE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAoB,MAAM,gBAAgB,CAAA;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAuB,MAAM,sBAAsB,CAAA;AACjG,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAErD,MAAM,iBA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AAI,EAAE,OAAO,CAAC,CAAA;IACxC,CAAC;IAED,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IAEpC,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAA;AAC3D,CAAC"}
|
|
@@ -1,9 +1,45 @@
|
|
|
1
1
|
import type { ContentBuilderInterface, ContentFields } from '../types/content-builder.js';
|
|
2
|
-
import type
|
|
2
|
+
import { RelationSet, type ChildRecord, type RelationOutput, type RelationOwner } from './relations.js';
|
|
3
|
+
declare const HEADING_LEVELS: {
|
|
4
|
+
readonly h1: 1;
|
|
5
|
+
readonly h2: 2;
|
|
6
|
+
readonly h3: 3;
|
|
7
|
+
readonly h4: 4;
|
|
8
|
+
readonly h5: 5;
|
|
9
|
+
readonly hidden: 100;
|
|
10
|
+
};
|
|
11
|
+
declare const BULLET_TYPES: {
|
|
12
|
+
readonly bullets: 0;
|
|
13
|
+
readonly numbers: 1;
|
|
14
|
+
readonly definition: 2;
|
|
15
|
+
};
|
|
16
|
+
declare const TABLE_HEADER_POSITIONS: {
|
|
17
|
+
readonly none: 0;
|
|
18
|
+
readonly top: 1;
|
|
19
|
+
readonly left: 2;
|
|
20
|
+
readonly both: 3;
|
|
21
|
+
};
|
|
22
|
+
declare const IMAGE_ORIENTATIONS: {
|
|
23
|
+
readonly 'above-center': 0;
|
|
24
|
+
readonly 'above-right': 1;
|
|
25
|
+
readonly 'above-left': 2;
|
|
26
|
+
readonly 'below-center': 8;
|
|
27
|
+
readonly 'below-right': 9;
|
|
28
|
+
readonly 'below-left': 10;
|
|
29
|
+
readonly 'in-text-right': 17;
|
|
30
|
+
readonly 'in-text-left': 18;
|
|
31
|
+
readonly 'beside-text-right': 25;
|
|
32
|
+
readonly 'beside-text-left': 26;
|
|
33
|
+
};
|
|
34
|
+
export type HeadingLevel = keyof typeof HEADING_LEVELS;
|
|
35
|
+
export type BulletType = keyof typeof BULLET_TYPES;
|
|
36
|
+
export type TableHeaderPosition = keyof typeof TABLE_HEADER_POSITIONS;
|
|
37
|
+
export type ImageOrientation = keyof typeof IMAGE_ORIENTATIONS;
|
|
3
38
|
export declare abstract class CoreContent implements ContentBuilderInterface {
|
|
4
39
|
abstract readonly type: string;
|
|
5
40
|
protected fields: ContentFields;
|
|
6
|
-
|
|
41
|
+
protected readonly relations: RelationSet;
|
|
42
|
+
withHeader(header: string, level?: HeadingLevel): this;
|
|
7
43
|
withSubheader(subheader: string): this;
|
|
8
44
|
/** 0 is "hidden", 1–5 are h1–h5 in a stock fluid_styled_content install. */
|
|
9
45
|
withHeaderLayout(layout: number): this;
|
|
@@ -12,24 +48,23 @@ export declare abstract class CoreContent implements ContentBuilderInterface {
|
|
|
12
48
|
setHidden(hidden?: boolean): this;
|
|
13
49
|
/** Any column the typed setters do not cover, including your own. */
|
|
14
50
|
withField(column: string, value: ContentFields[string]): this;
|
|
51
|
+
withFileReference(column: string, fileUid: number, fields?: ContentFields): this;
|
|
52
|
+
withFileReferences(column: string, fileUids: number[], fields?: ContentFields): this;
|
|
53
|
+
withChild(column: string, table: string, configure: (child: ChildRecord) => void): this;
|
|
54
|
+
withChildren<T>(column: string, table: string, items: T[], configure: (child: ChildRecord, item: T) => void): this;
|
|
55
|
+
getRelations(owner: RelationOwner): RelationOutput;
|
|
15
56
|
getFields(): ContentFields;
|
|
16
57
|
protected set(column: string, value: ContentFields[string]): this;
|
|
17
58
|
}
|
|
18
59
|
declare abstract class MediaCoreContent extends CoreContent {
|
|
19
60
|
/** The tt_content column the references hang off — `assets`, `image`, `media`. */
|
|
20
61
|
protected abstract readonly mediaColumn: string;
|
|
21
|
-
private fileUids;
|
|
22
|
-
private identifiers;
|
|
23
62
|
withFile(fileUid: number): this;
|
|
24
63
|
withFiles(fileUids: number[]): this;
|
|
25
|
-
getFields(): ContentFields;
|
|
26
|
-
getAdditionalRecords(contentIdentifier: string, pageId: string): RecordDataMap;
|
|
27
|
-
private referenceIdentifiers;
|
|
28
64
|
}
|
|
29
65
|
declare abstract class GalleryCoreContent extends MediaCoreContent {
|
|
30
66
|
withColumns(imagecols: number): this;
|
|
31
|
-
|
|
32
|
-
withOrientation(imageorient: number): this;
|
|
67
|
+
withOrientation(orientation: ImageOrientation): this;
|
|
33
68
|
withImageSize(width?: number, height?: number): this;
|
|
34
69
|
}
|
|
35
70
|
export declare class HeaderContent extends CoreContent {
|
|
@@ -57,15 +92,13 @@ export declare class BulletsContent extends CoreContent {
|
|
|
57
92
|
readonly type = "bullets";
|
|
58
93
|
/** One bullet per line — the column is a plain newline-separated text field. */
|
|
59
94
|
withItems(items: string[]): this;
|
|
60
|
-
|
|
61
|
-
withBulletsType(bulletsType: number): this;
|
|
95
|
+
withBulletsType(type: BulletType): this;
|
|
62
96
|
}
|
|
63
97
|
export declare class TableContent extends CoreContent {
|
|
64
98
|
readonly type = "table";
|
|
65
99
|
withRows(rows: string[][]): this;
|
|
66
100
|
withCaption(caption: string): this;
|
|
67
|
-
|
|
68
|
-
withHeaderPosition(position: number): this;
|
|
101
|
+
withHeaderPosition(position: TableHeaderPosition): this;
|
|
69
102
|
private delimiter;
|
|
70
103
|
}
|
|
71
104
|
export declare class UploadsContent extends MediaCoreContent {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-content.d.ts","sourceRoot":"","sources":["../../src/builders/core-content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AACzF,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"core-content.d.ts","sourceRoot":"","sources":["../../src/builders/core-content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AACzF,OAAO,EACH,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,aAAa,EACrB,MAAM,gBAAgB,C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-
import {
|
|
1
|
+
import { RelationSet, } from './relations.js';
|
|
2
|
+
const HEADING_LEVELS = { h1: 1, h2: 2, h3: 3, h4: 4, h5: 5, hidden: 100 };
|
|
3
|
+
const BULLET_TYPES = { bullets: 0, numbers: 1, definition: 2 };
|
|
4
|
+
const TABLE_HEADER_POSITIONS = { none: 0, top: 1, left: 2, both: 3 };
|
|
5
|
+
const IMAGE_ORIENTATIONS = {
|
|
6
|
+
'above-center': 0,
|
|
7
|
+
'above-right': 1,
|
|
8
|
+
'above-left': 2,
|
|
9
|
+
'below-center': 8,
|
|
10
|
+
'below-right': 9,
|
|
11
|
+
'below-left': 10,
|
|
12
|
+
'in-text-right': 17,
|
|
13
|
+
'in-text-left': 18,
|
|
14
|
+
'beside-text-right': 25,
|
|
15
|
+
'beside-text-left': 26,
|
|
16
|
+
};
|
|
2
17
|
export class CoreContent {
|
|
3
18
|
fields = {};
|
|
4
|
-
|
|
5
|
-
|
|
19
|
+
relations = new RelationSet('tt_content', (column) => column in this.fields);
|
|
20
|
+
withHeader(header, level) {
|
|
21
|
+
this.set('header', header);
|
|
22
|
+
return undefined === level ? this : this.withHeaderLayout(HEADING_LEVELS[level]);
|
|
6
23
|
}
|
|
7
24
|
withSubheader(subheader) {
|
|
8
25
|
return this.set('subheader', subheader);
|
|
@@ -24,66 +41,48 @@ export class CoreContent {
|
|
|
24
41
|
withField(column, value) {
|
|
25
42
|
return this.set(column, value);
|
|
26
43
|
}
|
|
44
|
+
withFileReference(column, fileUid, fields = {}) {
|
|
45
|
+
this.relations.withFileReference(column, fileUid, fields);
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
withFileReferences(column, fileUids, fields = {}) {
|
|
49
|
+
this.relations.withFileReferences(column, fileUids, fields);
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
withChild(column, table, configure) {
|
|
53
|
+
this.relations.withChild(column, table, configure);
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
withChildren(column, table, items, configure) {
|
|
57
|
+
this.relations.withChildren(column, table, items, configure);
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
getRelations(owner) {
|
|
61
|
+
return this.relations.materialise(owner);
|
|
62
|
+
}
|
|
27
63
|
getFields() {
|
|
28
64
|
return { CType: this.type, ...this.fields };
|
|
29
65
|
}
|
|
30
66
|
set(column, value) {
|
|
67
|
+
this.relations.refuseColumnHeld(column);
|
|
31
68
|
this.fields[column] = value;
|
|
32
69
|
return this;
|
|
33
70
|
}
|
|
34
71
|
}
|
|
35
72
|
class MediaCoreContent extends CoreContent {
|
|
36
|
-
fileUids = [];
|
|
37
|
-
identifiers = [];
|
|
38
73
|
withFile(fileUid) {
|
|
39
|
-
this.
|
|
40
|
-
return this;
|
|
74
|
+
return this.withFileReference(this.mediaColumn, fileUid);
|
|
41
75
|
}
|
|
42
76
|
withFiles(fileUids) {
|
|
43
|
-
this.
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
getFields() {
|
|
47
|
-
const fields = super.getFields();
|
|
48
|
-
if (this.fileUids.length > 0) {
|
|
49
|
-
fields[this.mediaColumn] = this.referenceIdentifiers().join(',');
|
|
50
|
-
}
|
|
51
|
-
return fields;
|
|
52
|
-
}
|
|
53
|
-
getAdditionalRecords(contentIdentifier, pageId) {
|
|
54
|
-
if (this.fileUids.length === 0) {
|
|
55
|
-
return {};
|
|
56
|
-
}
|
|
57
|
-
const identifiers = this.referenceIdentifiers();
|
|
58
|
-
const references = {};
|
|
59
|
-
this.fileUids.forEach((fileUid, index) => {
|
|
60
|
-
references[identifiers[index]] = {
|
|
61
|
-
uid_local: fileUid,
|
|
62
|
-
pid: pageId,
|
|
63
|
-
tablenames: 'tt_content',
|
|
64
|
-
fieldname: this.mediaColumn,
|
|
65
|
-
sys_language_uid: 0,
|
|
66
|
-
sorting_foreign: index + 1,
|
|
67
|
-
};
|
|
68
|
-
});
|
|
69
|
-
return { sys_file_reference: references };
|
|
70
|
-
}
|
|
71
|
-
// Minted once: getFields() lists them in the parent column and
|
|
72
|
-
// getAdditionalRecords() keys the children by them, and the two must agree.
|
|
73
|
-
referenceIdentifiers() {
|
|
74
|
-
while (this.identifiers.length < this.fileUids.length) {
|
|
75
|
-
this.identifiers.push(newRecordIdentifier());
|
|
76
|
-
}
|
|
77
|
-
return this.identifiers;
|
|
77
|
+
return this.withFileReferences(this.mediaColumn, fileUids);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
class GalleryCoreContent extends MediaCoreContent {
|
|
81
81
|
withColumns(imagecols) {
|
|
82
82
|
return this.set('imagecols', imagecols);
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return this.set('imageorient', imageorient);
|
|
84
|
+
withOrientation(orientation) {
|
|
85
|
+
return this.set('imageorient', IMAGE_ORIENTATIONS[orientation]);
|
|
87
86
|
}
|
|
88
87
|
withImageSize(width, height) {
|
|
89
88
|
if (undefined !== width) {
|
|
@@ -128,9 +127,8 @@ export class BulletsContent extends CoreContent {
|
|
|
128
127
|
withItems(items) {
|
|
129
128
|
return this.set('bodytext', items.join('\n'));
|
|
130
129
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
return this.set('bullets_type', bulletsType);
|
|
130
|
+
withBulletsType(type) {
|
|
131
|
+
return this.set('bullets_type', BULLET_TYPES[type]);
|
|
134
132
|
}
|
|
135
133
|
}
|
|
136
134
|
export class TableContent extends CoreContent {
|
|
@@ -142,9 +140,8 @@ export class TableContent extends CoreContent {
|
|
|
142
140
|
withCaption(caption) {
|
|
143
141
|
return this.set('table_caption', caption);
|
|
144
142
|
}
|
|
145
|
-
/** 1 puts the first row in a thead; 0 none, 2 first column, 3 both. */
|
|
146
143
|
withHeaderPosition(position) {
|
|
147
|
-
return this.set('table_header_position', position);
|
|
144
|
+
return this.set('table_header_position', TABLE_HEADER_POSITIONS[position]);
|
|
148
145
|
}
|
|
149
146
|
delimiter() {
|
|
150
147
|
const configured = this.fields.table_delimiter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-content.js","sourceRoot":"","sources":["../../src/builders/core-content.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core-content.js","sourceRoot":"","sources":["../../src/builders/core-content.ts"],"names":[],"mappings":"AACA,OAAO,EACH,WAAW,GAId,MAAM,gBAAgB,CAAA;AAEvB,MAAM,cAAc,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,EAAW,CAAA;AAClF,MAAM,YAAY,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAW,CAAA;AACvE,MAAM,sBAAsB,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAW,CAAA;AAC7E,MAAM,kBAAkB,GAAG;IACvB,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,EAAE;IAChB,eAAe,EAAE,EAAE;IACnB,cAAc,EAAE,EAAE;IAClB,mBAAmB,EAAE,EAAE;IACvB,kBAAkB,EAAE,EAAE;CAChB,CAAA;AAOV,MAAM,OAAgB,WAAW;IAGnB,MAAM,GAAkB,EAAE,CAAA;IACjB,SAAS,GAAG,IAAI,WAAW,CAC1C,YAAY,EACZ,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CACpC,CAAA;IAED,UAAU,CAAC,MAAc,EAAE,KAAoB;QAC3C,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QAE1B,OAAO,SAAS,KAA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