@websolutespa/payload-plugin-seo 2.0.1-next.3 → 3.0.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/CHANGELOG.md CHANGED
@@ -1,85 +1,85 @@
1
- # @websolutespa/payload-plugin-seo
2
-
3
- ## 2.0.1-next.3
4
-
5
- ### Patch Changes
6
-
7
- - - Fix token list retrieval, richText replacement (payload3)
8
-
9
- ## 2.0.1-next.2
10
-
11
- ### Patch Changes
12
-
13
- - Updating: dependencies and build step
14
-
15
- ## 2.0.1-next.0
16
-
17
- ### Major Changes
18
-
19
- - e74b305: Release: Payload 3.7.0
20
-
21
- ### Patch Changes
22
-
23
- - Updated dependencies [e74b305]
24
- - @websolutespa/payload-utils@2.0.1-next.0
25
- - @websolutespa/bom-core@2.0.1-next.0
26
-
27
- ## 0.1.4
28
-
29
- ### Patch Changes
30
-
31
- - - Improved rules evaluation performance
32
-
33
- ## 0.1.3
34
-
35
- ### Patch Changes
36
-
37
- - - Add rules field localization
38
-
39
- ## 0.1.2
40
-
41
- ### Patch Changes
42
-
43
- - 0b4e928: Modified: translations
44
- - Updated dependencies [0b4e928]
45
- - Updated dependencies [e921c43]
46
- - Updated dependencies [e921c43]
47
- - @websolutespa/payload-utils@0.0.3
48
-
49
- ## 0.1.1
50
-
51
- ### Patch Changes
52
-
53
- - 15ad595: Modified: payload local api consolidated overrideAccess
54
-
55
- ## 0.1.0
56
-
57
- ### Minor Changes
58
-
59
- - 8475b68: Added: external dependency payload-utils
60
- - 946a81f: Updating: dependency payload 2.28.0
61
-
62
- ### Patch Changes
63
-
64
- - Updated dependencies [8475b68]
65
- - @websolutespa/payload-utils@0.0.1
66
-
67
- ## 0.0.3
68
-
69
- ### Patch Changes
70
-
71
- - Fixing: utility functions exports
72
-
73
- ## 0.0.2
74
-
75
- ### Patch Changes
76
-
77
- - 882a9be: add token autocomplete
78
- add readme
79
- - 8696866: add new tests
80
-
81
- ## 0.0.1
82
-
83
- ### Patch Changes
84
-
85
- - 06a3127: Initial release
1
+ # @websolutespa/payload-plugin-seo
2
+
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Release: Bom 3.0
8
+
9
+ ## 2.0.1-next.4
10
+
11
+ ### Patch Changes
12
+
13
+ - Changed token autocomplete library
14
+
15
+ ## 2.0.1-next.3
16
+
17
+ ### Patch Changes
18
+
19
+ - Fix token list retrieval, richText replacement (payload3)
20
+
21
+ ## 2.0.1-next.2
22
+
23
+ ### Patch Changes
24
+
25
+ - Updating: dependencies and build step
26
+
27
+ ## 0.1.4
28
+
29
+ ### Patch Changes
30
+
31
+ - - Improved rules evaluation performance
32
+
33
+ ## 0.1.3
34
+
35
+ ### Patch Changes
36
+
37
+ - - Add rules field localization
38
+
39
+ ## 0.1.2
40
+
41
+ ### Patch Changes
42
+
43
+ - 0b4e928: Modified: translations
44
+ - Updated dependencies [0b4e928]
45
+ - Updated dependencies [e921c43]
46
+ - Updated dependencies [e921c43]
47
+ - @websolutespa/payload-utils@0.0.3
48
+
49
+ ## 0.1.1
50
+
51
+ ### Patch Changes
52
+
53
+ - 15ad595: Modified: payload local api consolidated overrideAccess
54
+
55
+ ## 0.1.0
56
+
57
+ ### Minor Changes
58
+
59
+ - 8475b68: Added: external dependency payload-utils
60
+ - 946a81f: Updating: dependency payload 2.28.0
61
+
62
+ ### Patch Changes
63
+
64
+ - Updated dependencies [8475b68]
65
+ - @websolutespa/payload-utils@0.0.1
66
+
67
+ ## 0.0.3
68
+
69
+ ### Patch Changes
70
+
71
+ - Fixing: utility functions exports
72
+
73
+ ## 0.0.2
74
+
75
+ ### Patch Changes
76
+
77
+ - 882a9be: add token autocomplete
78
+ add readme
79
+ - 8696866: add new tests
80
+
81
+ ## 0.0.1
82
+
83
+ ### Patch Changes
84
+
85
+ - 06a3127: Initial release
@@ -2,15 +2,53 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { FieldLabel, useField, useFormFields } from '@payloadcms/ui';
4
4
  import * as React from 'react';
5
- import TextInput from 'react-autocomplete-input';
5
+ import { Mention, MentionsInput } from 'react-mentions';
6
6
  const baseClass = 'text-with-tokens';
7
+ const mentionsStyle = {
8
+ control: {
9
+ display: 'block',
10
+ width: '100%'
11
+ },
12
+ '&singleLine': {
13
+ input: {
14
+ width: '100%',
15
+ padding: '0.375rem 0.75rem',
16
+ border: '1px solid var(--theme-elevation-150)',
17
+ borderRadius: 'var(--border-radius)',
18
+ backgroundColor: 'var(--theme-input-bg)',
19
+ color: 'var(--theme-text)',
20
+ fontSize: '1rem',
21
+ lineHeight: '1.5',
22
+ outline: 'none'
23
+ },
24
+ highlighter: {
25
+ padding: '0.375rem 0.75rem',
26
+ border: '1px solid transparent'
27
+ }
28
+ },
29
+ suggestions: {
30
+ list: {
31
+ backgroundColor: 'var(--theme-bg)',
32
+ border: '1px solid var(--theme-elevation-150)',
33
+ borderRadius: 'var(--border-radius)',
34
+ maxHeight: '200px',
35
+ overflowY: 'auto'
36
+ },
37
+ item: {
38
+ padding: '4px 12px',
39
+ '&focused': {
40
+ backgroundColor: 'var(--theme-elevation-50)'
41
+ }
42
+ }
43
+ }
44
+ };
7
45
  export const TextWithTokens = (props)=>{
8
46
  const { path, field } = props;
9
47
  const { label, required } = field;
10
48
  const { value, setValue } = useField({
11
49
  path
12
50
  });
13
- const tokensField = useFormFields(([fields, dispatch])=>fields.tokens);
51
+ const tokensField = useFormFields(([fields])=>fields.tokens);
14
52
  let tokens = tokensField?.value || [];
15
53
  tokens = tokens.map((token)=>token.replace('[', '').replace(']', ''));
16
54
  const classes = [
@@ -26,17 +64,21 @@ export const TextWithTokens = (props)=>{
26
64
  path: path,
27
65
  required: required
28
66
  }),
29
- /*#__PURE__*/ _jsx(TextInput, {
30
- trigger: [
31
- '['
32
- ],
33
- options: {
34
- '[': tokens
35
- },
36
- maxOptions: 50,
37
- spacer: '] ',
38
- defaultValue: value,
39
- onChange: (e)=>setValue(e)
67
+ /*#__PURE__*/ _jsx(MentionsInput, {
68
+ singleLine: true,
69
+ value: value ?? '',
70
+ onChange: (_, newValue)=>setValue(newValue),
71
+ style: mentionsStyle,
72
+ children: /*#__PURE__*/ _jsx(Mention, {
73
+ trigger: "[",
74
+ data: tokens.map((t)=>({
75
+ id: t,
76
+ display: t
77
+ })),
78
+ markup: "[__display__]",
79
+ displayTransform: (_, display)=>`[${display}]`,
80
+ appendSpaceOnAdd: true
81
+ })
40
82
  })
41
83
  ]
42
84
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/TextWithTokens.tsx"],"sourcesContent":["'use client';\r\n\r\nimport { FieldLabel, useField, useFormFields } from '@payloadcms/ui';\r\nimport { TextFieldClientProps } from 'payload';\r\nimport * as React from 'react';\r\nimport TextInput from 'react-autocomplete-input';\r\n\r\nconst baseClass = 'text-with-tokens';\r\n\r\nexport const TextWithTokens: React.FC<TextFieldClientProps> = (props) => {\r\n const { path, field } = props;\r\n const { label, required } = field;\r\n const { value, setValue } = useField<string>({ path });\r\n\r\n const tokensField = useFormFields(([fields, dispatch]) => fields.tokens);\r\n let tokens = (tokensField?.value as string[]) || [];\r\n tokens = tokens.map((token) => token.replace('[', '').replace(']', ''));\r\n\r\n const classes = ['field-type', 'textarea', baseClass].join(' ');\r\n\r\n return (\r\n <div className={classes}>\r\n <FieldLabel label={label} path={path} required={required} />\r\n <TextInput\r\n trigger={['[']}\r\n options={{ '[': tokens }}\r\n maxOptions={50}\r\n spacer={'] '}\r\n defaultValue={value}\r\n onChange={(e) => setValue(e)}\r\n />\r\n </div>\r\n );\r\n};\r\n"],"names":["FieldLabel","useField","useFormFields","React","TextInput","baseClass","TextWithTokens","props","path","field","label","required","value","setValue","tokensField","fields","dispatch","tokens","map","token","replace","classes","join","div","className","trigger","options","maxOptions","spacer","defaultValue","onChange","e"],"mappings":"AAAA;;AAEA,SAASA,UAAU,EAAEC,QAAQ,EAAEC,aAAa,QAAQ,iBAAiB;AAErE,YAAYC,WAAW,QAAQ;AAC/B,OAAOC,eAAe,2BAA2B;AAEjD,MAAMC,YAAY;AAElB,OAAO,MAAMC,iBAAiD,CAACC;IAC7D,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGF;IACxB,MAAM,EAAEG,KAAK,EAAEC,QAAQ,EAAE,GAAGF;IAC5B,MAAM,EAAEG,KAAK,EAAEC,QAAQ,EAAE,GAAGZ,SAAiB;QAAEO;IAAK;IAEpD,MAAMM,cAAcZ,cAAc,CAAC,CAACa,QAAQC,SAAS,GAAKD,OAAOE,MAAM;IACvE,IAAIA,SAAS,AAACH,aAAaF,SAAsB,EAAE;IACnDK,SAASA,OAAOC,GAAG,CAAC,CAACC,QAAUA,MAAMC,OAAO,CAAC,KAAK,IAAIA,OAAO,CAAC,KAAK;IAEnE,MAAMC,UAAU;QAAC;QAAc;QAAYhB;KAAU,CAACiB,IAAI,CAAC;IAE3D,qBACE,MAACC;QAAIC,WAAWH;;0BACd,KAACrB;gBAAWU,OAAOA;gBAAOF,MAAMA;gBAAMG,UAAUA;;0BAChD,KAACP;gBACCqB,SAAS;oBAAC;iBAAI;gBACdC,SAAS;oBAAE,KAAKT;gBAAO;gBACvBU,YAAY;gBACZC,QAAQ;gBACRC,cAAcjB;gBACdkB,UAAU,CAACC,IAAMlB,SAASkB;;;;AAIlC,EAAE"}
1
+ {"version":3,"sources":["../../src/components/TextWithTokens.tsx"],"sourcesContent":["'use client';\r\n\r\nimport { FieldLabel, useField, useFormFields } from '@payloadcms/ui';\r\nimport { TextFieldClientProps } from 'payload';\r\nimport * as React from 'react';\r\nimport { Mention, MentionsInput } from 'react-mentions';\r\n\r\nconst baseClass = 'text-with-tokens';\r\n\r\nconst mentionsStyle = {\r\n control: {\r\n display: 'block',\r\n width: '100%',\r\n },\r\n '&singleLine': {\r\n input: {\r\n width: '100%',\r\n padding: '0.375rem 0.75rem',\r\n border: '1px solid var(--theme-elevation-150)',\r\n borderRadius: 'var(--border-radius)',\r\n backgroundColor: 'var(--theme-input-bg)',\r\n color: 'var(--theme-text)',\r\n fontSize: '1rem',\r\n lineHeight: '1.5',\r\n outline: 'none',\r\n },\r\n highlighter: {\r\n padding: '0.375rem 0.75rem',\r\n border: '1px solid transparent',\r\n },\r\n },\r\n suggestions: {\r\n list: {\r\n backgroundColor: 'var(--theme-bg)',\r\n border: '1px solid var(--theme-elevation-150)',\r\n borderRadius: 'var(--border-radius)',\r\n maxHeight: '200px',\r\n overflowY: 'auto' as const,\r\n },\r\n item: {\r\n padding: '4px 12px',\r\n '&focused': {\r\n backgroundColor: 'var(--theme-elevation-50)',\r\n },\r\n },\r\n },\r\n};\r\n\r\nexport const TextWithTokens: React.FC<TextFieldClientProps> = (props) => {\r\n const { path, field } = props;\r\n const { label, required } = field;\r\n const { value, setValue } = useField<string>({ path });\r\n\r\n const tokensField = useFormFields(([fields]) => fields.tokens);\r\n let tokens = (tokensField?.value as string[]) || [];\r\n tokens = tokens.map((token) => token.replace('[', '').replace(']', ''));\r\n\r\n const classes = ['field-type', 'textarea', baseClass].join(' ');\r\n\r\n return (\r\n <div className={classes}>\r\n <FieldLabel label={label} path={path} required={required} />\r\n <MentionsInput\r\n singleLine\r\n value={value ?? ''}\r\n onChange={(_, newValue) => setValue(newValue)}\r\n style={mentionsStyle}\r\n >\r\n <Mention\r\n trigger=\"[\"\r\n data={tokens.map((t) => ({ id: t, display: t }))}\r\n markup=\"[__display__]\"\r\n displayTransform={(_, display) => `[${display}]`}\r\n appendSpaceOnAdd\r\n />\r\n </MentionsInput>\r\n </div>\r\n );\r\n};\r\n"],"names":["FieldLabel","useField","useFormFields","React","Mention","MentionsInput","baseClass","mentionsStyle","control","display","width","input","padding","border","borderRadius","backgroundColor","color","fontSize","lineHeight","outline","highlighter","suggestions","list","maxHeight","overflowY","item","TextWithTokens","props","path","field","label","required","value","setValue","tokensField","fields","tokens","map","token","replace","classes","join","div","className","singleLine","onChange","_","newValue","style","trigger","data","t","id","markup","displayTransform","appendSpaceOnAdd"],"mappings":"A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AU,CAACC,GAAGC,WAAad,SAASc;gBACpCC,OAAOzC;0BAEP,cAAA,KAACH;oBACC6C,SAAQ;oBACRC,MAAMd,OAAOC,GAAG,CAAC,CAACc,IAAO,CAAA;4BAAEC,IAAID;4BAAG1C,SAAS0C;wBAAE,CAAA;oBAC7CE,QAAO;oBACPC,kBAAkB,CAACR,GAAGrC,UAAY,CAAC,CAAC,EAAEA,QAAQ,CAAC,CAAC;oBAChD8C,gBAAgB;;;;;AAK1B,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","names":[],"sources":["../../src/components/TextWithTokens.tsx","../../src/components/Tokens.tsx"],"sourcesContent":[],"mappings":";;;;cASa,gBAAgB,KAAA,CAAM,GAAG;;;;cCFzB,QAAQ,KAAA,CAAM,GAAG"}
1
+ {"version":3,"file":"client.d.ts","names":[],"sources":["../../src/components/TextWithTokens.tsx","../../src/components/Tokens.tsx"],"sourcesContent":[],"mappings":";;;;cAgDa,gBAAgB,KAAA,CAAM,GAAG;;;;cCzCzB,QAAQ,KAAA,CAAM,GAAG"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  export { TextWithTokens } from '../components/TextWithTokens';
2
3
  export { Tokens } from '../components/Tokens';
3
4
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["export { TextWithTokens } from '../components/TextWithTokens';\r\nexport { Tokens } from '../components/Tokens';\r\n"],"names":["TextWithTokens","Tokens"],"mappings":"AAAA,SAASA,cAAc,QAAQ,+BAA+B;AAC9D,SAASC,MAAM,QAAQ,uBAAuB"}
1
+ {"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["'use client';\r\n\r\nexport { TextWithTokens } from '../components/TextWithTokens';\r\nexport { Tokens } from '../components/Tokens';\r\n\r\n"],"names":["TextWithTokens","Tokens"],"mappings":"AAAA;AAEA,SAASA,cAAc,QAAQ,+BAA+B;AAC9D,SAASC,MAAM,QAAQ,uBAAuB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websolutespa/payload-plugin-seo",
3
- "version": "2.0.1-next.3",
3
+ "version": "3.0.0",
4
4
  "description": "SEO plugin for PayloadCms",
5
5
  "keywords": [
6
6
  "payload",
@@ -29,42 +29,43 @@
29
29
  "types": "tsc --noemit"
30
30
  },
31
31
  "dependencies": {
32
- "react-autocomplete-input": "^1.0.31",
32
+ "react-mentions": "^4.4.10",
33
33
  "ts-deepmerge": "^2.0.1"
34
34
  },
35
35
  "peerDependencies": {
36
- "@payloadcms/db-mongodb": "3.70.0",
37
- "@websolutespa/bom-core": "2.0.1-next.2",
38
- "@websolutespa/payload-utils": "2.0.1-next.2",
39
- "@payloadcms/ui": "3.70.0",
40
- "payload": "3.70.0",
41
- "react": "19.2.1",
42
- "react-dom": "19.2.1",
36
+ "@payloadcms/db-mongodb": "3.74.0",
37
+ "@websolutespa/bom-core": "*",
38
+ "@websolutespa/payload-utils": "*",
39
+ "@payloadcms/ui": "3.74.0",
40
+ "payload": "3.74.0",
41
+ "react": "19.2.3",
42
+ "react-dom": "19.2.3",
43
43
  "uuid": "9.0.1"
44
44
  },
45
45
  "devDependencies": {
46
- "@payloadcms/db-mongodb": "3.70.0",
47
- "@payloadcms/ui": "3.70.0",
46
+ "@payloadcms/db-mongodb": "3.74.0",
47
+ "@payloadcms/ui": "3.74.0",
48
48
  "@swc-node/register": "1.10.9",
49
49
  "@swc/cli": "0.6.0",
50
50
  "@swc/core": "1.6.4",
51
51
  "@types/express": "^4.17.15",
52
- "@types/react-dom": "19.2.1",
53
- "@types/react": "19.2.1",
52
+ "@types/react-dom": "19.2.3",
53
+ "@types/react-mentions": "^4.4.1",
54
+ "@types/react": "19.2.10",
54
55
  "@types/uuid": "^9.0.2",
55
- "@websolutespa/bom-core": "2.0.1-next.2",
56
- "@websolutespa/eslint-config": "2.0.1-next.2",
57
- "@websolutespa/payload-utils": "2.0.1-next.2",
58
- "@websolutespa/test": "2.0.1-next.2",
59
- "@websolutespa/tsconfig": "2.0.1-next.2",
56
+ "@websolutespa/bom-core": "*",
57
+ "@websolutespa/eslint-config": "*",
58
+ "@websolutespa/payload-utils": "*",
59
+ "@websolutespa/test": "*",
60
+ "@websolutespa/tsconfig": "*",
60
61
  "copyfiles": "2.4.1",
61
62
  "esbuild-sass-plugin": "2.16.1",
62
63
  "eslint": "9.31.0",
63
64
  "mongodb-memory-server": "10.1.4",
64
65
  "npm-run-all": "4.1.5",
65
- "payload": "3.70.0",
66
- "react-dom": "19.2.1",
67
- "react": "19.2.1",
66
+ "payload": "3.74.0",
67
+ "react-dom": "19.2.3",
68
+ "react": "19.2.3",
68
69
  "tsdown": "0.12.9",
69
70
  "typescript": "5.8.3",
70
71
  "uuid": "9.0.1"