@foundrykit/payload-fields 1.0.1 → 1.1.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/dist/index.d.ts
CHANGED
|
@@ -16,3 +16,4 @@ export { SOCIAL_PLATFORMS, socials } from './fields/socials/index.js';
|
|
|
16
16
|
export { tags } from './fields/tags/index.js';
|
|
17
17
|
export { tag } from './fields/tags/tag.js';
|
|
18
18
|
export { default as deepMerge } from './utilities/deepMerge.js';
|
|
19
|
+
export { recordActivePlugin } from './utilities/recordActivePlugin.js';
|
package/dist/index.js
CHANGED
|
@@ -17,5 +17,6 @@ export { SOCIAL_PLATFORMS, socials } from './fields/socials/index.js';
|
|
|
17
17
|
export { tags } from './fields/tags/index.js';
|
|
18
18
|
export { tag } from './fields/tags/tag.js';
|
|
19
19
|
export { default as deepMerge } from './utilities/deepMerge.js';
|
|
20
|
+
export { recordActivePlugin } from './utilities/recordActivePlugin.js';
|
|
20
21
|
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Field factories and RSC-safe helpers: safe to import in payload.config and in Server Components.\n\nexport { address } from './fields/address/index.js';\nexport { bestTimeToVisitMonths } from './fields/bestTimeToVisit/index.js';\nexport { budgetField } from './fields/budget/index.js';\nexport { changedByFields } from './fields/changedBy/index.js';\nexport { populateChangedBy } from './fields/changedBy/populateChangedBy.js';\nexport {\n countryCodeField,\n ISO_COUNTRY_OPTIONS,\n} from './fields/countryCode/index.js';\nexport { dateRangeField } from './fields/dateRange/index.js';\nexport { gallery } from './fields/gallery/index.js';\nexport { ICONS, icon } from './fields/icon/index.js';\nexport {\n type ImageMapValue,\n imageMap,\n type Waypoint,\n} from './fields/imageMap/index.js';\nexport { type LinkOptions, link, linkGroup } from './fields/link/index.js';\nexport {\n type LinkValue,\n type ResolvedLink,\n resolveLink,\n} from './fields/link/resolveLink.js';\nexport { openingTimes } from './fields/openingTimes/index.js';\nexport { openingTime } from './fields/openingTimes/opening-time.js';\nexport { SOCIAL_PLATFORMS, socials } from './fields/socials/index.js';\nexport { tags } from './fields/tags/index.js';\nexport { tag } from './fields/tags/tag.js';\nexport { default as deepMerge } from './utilities/deepMerge.js';\n"],"names":["address","bestTimeToVisitMonths","budgetField","changedByFields","populateChangedBy","countryCodeField","ISO_COUNTRY_OPTIONS","dateRangeField","gallery","ICONS","icon","imageMap","link","linkGroup","resolveLink","openingTimes","openingTime","SOCIAL_PLATFORMS","socials","tags","tag","default","deepMerge"],"mappings":"AAAA,mGAAmG;AAEnG,SAASA,OAAO,QAAQ,4BAA4B;AACpD,SAASC,qBAAqB,QAAQ,oCAAoC;AAC1E,SAASC,WAAW,QAAQ,2BAA2B;AACvD,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,iBAAiB,QAAQ,0CAA0C;AAC5E,SACEC,gBAAgB,EAChBC,mBAAmB,QACd,gCAAgC;AACvC,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,OAAO,QAAQ,4BAA4B;AACpD,SAASC,KAAK,EAAEC,IAAI,QAAQ,yBAAyB;AACrD,SAEEC,QAAQ,QAEH,6BAA6B;AACpC,SAA2BC,IAAI,EAAEC,SAAS,QAAQ,yBAAyB;AAC3E,SAGEC,WAAW,QACN,+BAA+B;AACtC,SAASC,YAAY,QAAQ,iCAAiC;AAC9D,SAASC,WAAW,QAAQ,wCAAwC;AACpE,SAASC,gBAAgB,EAAEC,OAAO,QAAQ,4BAA4B;AACtE,SAASC,IAAI,QAAQ,yBAAyB;AAC9C,SAASC,GAAG,QAAQ,uBAAuB;AAC3C,SAASC,WAAWC,SAAS,QAAQ,2BAA2B"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Field factories and RSC-safe helpers: safe to import in payload.config and in Server Components.\n\nexport { address } from './fields/address/index.js';\nexport { bestTimeToVisitMonths } from './fields/bestTimeToVisit/index.js';\nexport { budgetField } from './fields/budget/index.js';\nexport { changedByFields } from './fields/changedBy/index.js';\nexport { populateChangedBy } from './fields/changedBy/populateChangedBy.js';\nexport {\n countryCodeField,\n ISO_COUNTRY_OPTIONS,\n} from './fields/countryCode/index.js';\nexport { dateRangeField } from './fields/dateRange/index.js';\nexport { gallery } from './fields/gallery/index.js';\nexport { ICONS, icon } from './fields/icon/index.js';\nexport {\n type ImageMapValue,\n imageMap,\n type Waypoint,\n} from './fields/imageMap/index.js';\nexport { type LinkOptions, link, linkGroup } from './fields/link/index.js';\nexport {\n type LinkValue,\n type ResolvedLink,\n resolveLink,\n} from './fields/link/resolveLink.js';\nexport { openingTimes } from './fields/openingTimes/index.js';\nexport { openingTime } from './fields/openingTimes/opening-time.js';\nexport { SOCIAL_PLATFORMS, socials } from './fields/socials/index.js';\nexport { tags } from './fields/tags/index.js';\nexport { tag } from './fields/tags/tag.js';\nexport { default as deepMerge } from './utilities/deepMerge.js';\nexport { recordActivePlugin } from './utilities/recordActivePlugin.js';\n"],"names":["address","bestTimeToVisitMonths","budgetField","changedByFields","populateChangedBy","countryCodeField","ISO_COUNTRY_OPTIONS","dateRangeField","gallery","ICONS","icon","imageMap","link","linkGroup","resolveLink","openingTimes","openingTime","SOCIAL_PLATFORMS","socials","tags","tag","default","deepMerge","recordActivePlugin"],"mappings":"AAAA,mGAAmG;AAEnG,SAASA,OAAO,QAAQ,4BAA4B;AACpD,SAASC,qBAAqB,QAAQ,oCAAoC;AAC1E,SAASC,WAAW,QAAQ,2BAA2B;AACvD,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,iBAAiB,QAAQ,0CAA0C;AAC5E,SACEC,gBAAgB,EAChBC,mBAAmB,QACd,gCAAgC;AACvC,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,OAAO,QAAQ,4BAA4B;AACpD,SAASC,KAAK,EAAEC,IAAI,QAAQ,yBAAyB;AACrD,SAEEC,QAAQ,QAEH,6BAA6B;AACpC,SAA2BC,IAAI,EAAEC,SAAS,QAAQ,yBAAyB;AAC3E,SAGEC,WAAW,QACN,+BAA+B;AACtC,SAASC,YAAY,QAAQ,iCAAiC;AAC9D,SAASC,WAAW,QAAQ,wCAAwC;AACpE,SAASC,gBAAgB,EAAEC,OAAO,QAAQ,4BAA4B;AACtE,SAASC,IAAI,QAAQ,yBAAyB;AAC9C,SAASC,GAAG,QAAQ,uBAAuB;AAC3C,SAASC,WAAWC,SAAS,QAAQ,2BAA2B;AAChE,SAASC,kBAAkB,QAAQ,oCAAoC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Config } from 'payload';
|
|
2
|
+
/**
|
|
3
|
+
* Records a plugin as active in `config.custom.foundrykit.activePlugins`, the list
|
|
4
|
+
* `@foundrykit/guides-plugin` sends to the guides hub so the site gets that plugin's guides.
|
|
5
|
+
* Only call it on the enabled path: installed-but-disabled doesn't count.
|
|
6
|
+
*/
|
|
7
|
+
export declare const recordActivePlugin: (config: Config, name: string) => Config;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Records a plugin as active in `config.custom.foundrykit.activePlugins`, the list
|
|
3
|
+
* `@foundrykit/guides-plugin` sends to the guides hub so the site gets that plugin's guides.
|
|
4
|
+
* Only call it on the enabled path: installed-but-disabled doesn't count.
|
|
5
|
+
*/ export const recordActivePlugin = (config, name)=>{
|
|
6
|
+
const foundrykit = config.custom?.foundrykit ?? {};
|
|
7
|
+
return {
|
|
8
|
+
...config,
|
|
9
|
+
custom: {
|
|
10
|
+
...config.custom,
|
|
11
|
+
foundrykit: {
|
|
12
|
+
...foundrykit,
|
|
13
|
+
activePlugins: [
|
|
14
|
+
...new Set([
|
|
15
|
+
...foundrykit.activePlugins ?? [],
|
|
16
|
+
name
|
|
17
|
+
])
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=recordActivePlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/recordActivePlugin.ts"],"sourcesContent":["import type { Config } from 'payload';\n\n/**\n * Records a plugin as active in `config.custom.foundrykit.activePlugins`, the list\n * `@foundrykit/guides-plugin` sends to the guides hub so the site gets that plugin's guides.\n * Only call it on the enabled path: installed-but-disabled doesn't count.\n */\nexport const recordActivePlugin = (config: Config, name: string): Config => {\n const foundrykit = (config.custom?.foundrykit ?? {}) as {\n activePlugins?: string[];\n };\n return {\n ...config,\n custom: {\n ...config.custom,\n foundrykit: {\n ...foundrykit,\n activePlugins: [\n ...new Set([...(foundrykit.activePlugins ?? []), name]),\n ],\n },\n },\n };\n};\n"],"names":["recordActivePlugin","config","name","foundrykit","custom","activePlugins","Set"],"mappings":"AAEA;;;;CAIC,GACD,OAAO,MAAMA,qBAAqB,CAACC,QAAgBC;IACjD,MAAMC,aAAcF,OAAOG,MAAM,EAAED,cAAc,CAAC;IAGlD,OAAO;QACL,GAAGF,MAAM;QACTG,QAAQ;YACN,GAAGH,OAAOG,MAAM;YAChBD,YAAY;gBACV,GAAGA,UAAU;gBACbE,eAAe;uBACV,IAAIC,IAAI;2BAAKH,WAAWE,aAAa,IAAI,EAAE;wBAAGH;qBAAK;iBACvD;YACH;QACF;IACF;AACF,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foundrykit/payload-fields",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Reusable field factories for Payload CMS 3: link, linkGroup, socials, icon, address, opening times, gallery, tags, image map and more, plus RSC-safe frontend helpers like resolveLink.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|