@wordpress/fields 0.2.0 → 0.3.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.
Files changed (113) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +12 -0
  3. package/build/actions/delete-post.js +4 -4
  4. package/build/actions/delete-post.js.map +1 -1
  5. package/build/actions/duplicate-post.js +2 -2
  6. package/build/actions/duplicate-post.js.map +1 -1
  7. package/build/actions/view-post-revisions.js +1 -1
  8. package/build/actions/view-post-revisions.js.map +1 -1
  9. package/build/fields/featured-image/featured-image-edit.js +113 -0
  10. package/build/fields/featured-image/featured-image-edit.js.map +1 -0
  11. package/build/fields/featured-image/featured-image-view.js +41 -0
  12. package/build/fields/featured-image/featured-image-view.js.map +1 -0
  13. package/build/fields/featured-image/index.js +30 -0
  14. package/build/fields/featured-image/index.js.map +1 -0
  15. package/build/fields/index.js +21 -0
  16. package/build/fields/index.js.map +1 -1
  17. package/build/fields/parent/index.js +34 -0
  18. package/build/fields/parent/index.js.map +1 -0
  19. package/build/fields/parent/parent-edit.js +243 -0
  20. package/build/fields/parent/parent-edit.js.map +1 -0
  21. package/build/fields/parent/parent-view.js +39 -0
  22. package/build/fields/parent/parent-view.js.map +1 -0
  23. package/build/fields/parent/utils.js +20 -0
  24. package/build/fields/parent/utils.js.map +1 -0
  25. package/build/fields/slug/index.js +30 -0
  26. package/build/fields/slug/index.js.map +1 -0
  27. package/build/fields/slug/slug-edit.js +132 -0
  28. package/build/fields/slug/slug-edit.js.map +1 -0
  29. package/build/fields/slug/slug-view.js +30 -0
  30. package/build/fields/slug/slug-view.js.map +1 -0
  31. package/build/mutation/index.js +2 -2
  32. package/build/mutation/index.js.map +1 -1
  33. package/build/types.js.map +1 -1
  34. package/build-module/actions/delete-post.js +5 -5
  35. package/build-module/actions/delete-post.js.map +1 -1
  36. package/build-module/actions/duplicate-post.js +2 -2
  37. package/build-module/actions/duplicate-post.js.map +1 -1
  38. package/build-module/actions/view-post-revisions.js +1 -1
  39. package/build-module/actions/view-post-revisions.js.map +1 -1
  40. package/build-module/fields/featured-image/featured-image-edit.js +105 -0
  41. package/build-module/fields/featured-image/featured-image-edit.js.map +1 -0
  42. package/build-module/fields/featured-image/featured-image-view.js +33 -0
  43. package/build-module/fields/featured-image/featured-image-view.js.map +1 -0
  44. package/build-module/fields/featured-image/index.js +24 -0
  45. package/build-module/fields/featured-image/index.js.map +1 -0
  46. package/build-module/fields/index.js +3 -0
  47. package/build-module/fields/index.js.map +1 -1
  48. package/build-module/fields/parent/index.js +28 -0
  49. package/build-module/fields/parent/index.js.map +1 -0
  50. package/build-module/fields/parent/parent-edit.js +230 -0
  51. package/build-module/fields/parent/parent-edit.js.map +1 -0
  52. package/build-module/fields/parent/parent-view.js +32 -0
  53. package/build-module/fields/parent/parent-view.js.map +1 -0
  54. package/build-module/fields/parent/utils.js +14 -0
  55. package/build-module/fields/parent/utils.js.map +1 -0
  56. package/build-module/fields/slug/index.js +23 -0
  57. package/build-module/fields/slug/index.js.map +1 -0
  58. package/build-module/fields/slug/slug-edit.js +125 -0
  59. package/build-module/fields/slug/slug-edit.js.map +1 -0
  60. package/build-module/fields/slug/slug-view.js +24 -0
  61. package/build-module/fields/slug/slug-view.js.map +1 -0
  62. package/build-module/mutation/index.js +2 -2
  63. package/build-module/mutation/index.js.map +1 -1
  64. package/build-module/types.js.map +1 -1
  65. package/build-style/styles-rtl.css +134 -0
  66. package/build-style/styles.css +134 -0
  67. package/build-types/actions/delete-post.d.ts.map +1 -1
  68. package/build-types/fields/featured-image/featured-image-edit.d.ts +7 -0
  69. package/build-types/fields/featured-image/featured-image-edit.d.ts.map +1 -0
  70. package/build-types/fields/featured-image/featured-image-view.d.ts +7 -0
  71. package/build-types/fields/featured-image/featured-image-view.d.ts.map +1 -0
  72. package/build-types/fields/featured-image/index.d.ts +11 -0
  73. package/build-types/fields/featured-image/index.d.ts.map +1 -0
  74. package/build-types/fields/index.d.ts +3 -0
  75. package/build-types/fields/index.d.ts.map +1 -1
  76. package/build-types/fields/parent/index.d.ts +14 -0
  77. package/build-types/fields/parent/index.d.ts.map +1 -0
  78. package/build-types/fields/parent/parent-edit.d.ts +9 -0
  79. package/build-types/fields/parent/parent-edit.d.ts.map +1 -0
  80. package/build-types/fields/parent/parent-view.d.ts +7 -0
  81. package/build-types/fields/parent/parent-view.d.ts.map +1 -0
  82. package/build-types/fields/parent/utils.d.ts +6 -0
  83. package/build-types/fields/parent/utils.d.ts.map +1 -0
  84. package/build-types/fields/slug/index.d.ts +11 -0
  85. package/build-types/fields/slug/index.d.ts.map +1 -0
  86. package/build-types/fields/slug/slug-edit.d.ts +8 -0
  87. package/build-types/fields/slug/slug-edit.d.ts.map +1 -0
  88. package/build-types/fields/slug/slug-view.d.ts +9 -0
  89. package/build-types/fields/slug/slug-view.d.ts.map +1 -0
  90. package/build-types/types.d.ts +2 -0
  91. package/build-types/types.d.ts.map +1 -1
  92. package/package.json +26 -22
  93. package/src/actions/delete-post.tsx +8 -5
  94. package/src/actions/duplicate-post.tsx +2 -2
  95. package/src/actions/view-post-revisions.tsx +1 -1
  96. package/src/fields/featured-image/featured-image-edit.tsx +122 -0
  97. package/src/fields/featured-image/featured-image-view.tsx +38 -0
  98. package/src/fields/featured-image/index.ts +24 -0
  99. package/src/fields/featured-image/style.scss +95 -0
  100. package/src/fields/index.ts +3 -0
  101. package/src/fields/parent/index.ts +27 -0
  102. package/src/fields/parent/parent-edit.tsx +348 -0
  103. package/src/fields/parent/parent-view.tsx +33 -0
  104. package/src/fields/parent/utils.ts +18 -0
  105. package/src/fields/slug/index.ts +23 -0
  106. package/src/fields/slug/slug-edit.tsx +156 -0
  107. package/src/fields/slug/slug-view.tsx +26 -0
  108. package/src/fields/slug/style.scss +22 -0
  109. package/src/mutation/index.ts +3 -3
  110. package/src/styles.scss +1 -0
  111. package/src/types.ts +2 -0
  112. package/tsconfig.json +3 -1
  113. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Converts a hex value into the rgb equivalent.
3
+ *
4
+ * @param {string} hex - the hexadecimal value to convert
5
+ * @return {string} comma separated rgb values
6
+ */
7
+ /**
8
+ * Colors
9
+ */
10
+ /**
11
+ * Breakpoints & Media Queries
12
+ */
13
+ /**
14
+ * SCSS Variables.
15
+ *
16
+ * Please use variables from this sheet to ensure consistency across the UI.
17
+ * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
18
+ * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
19
+ */
20
+ /**
21
+ * Converts a hex value into the rgb equivalent.
22
+ *
23
+ * @param {string} hex - the hexadecimal value to convert
24
+ * @return {string} comma separated rgb values
25
+ */
26
+ /**
27
+ * Colors
28
+ */
29
+ /**
30
+ * Fonts & basic variables.
31
+ */
32
+ /**
33
+ * Typography
34
+ */
35
+ /**
36
+ * Grid System.
37
+ * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
38
+ */
39
+ /**
40
+ * Radius scale.
41
+ */
42
+ /**
43
+ * Elevation scale.
44
+ */
45
+ /**
46
+ * Dimensions.
47
+ */
48
+ /**
49
+ * Mobile specific styles
50
+ */
51
+ /**
52
+ * Editor styles.
53
+ */
54
+ /**
55
+ * Block & Editor UI.
56
+ */
57
+ /**
58
+ * Block paddings.
59
+ */
60
+ /**
61
+ * React Native specific.
62
+ * These variables do not appear to be used anywhere else.
63
+ */
64
+ /**
65
+ * Converts a hex value into the rgb equivalent.
66
+ *
67
+ * @param {string} hex - the hexadecimal value to convert
68
+ * @return {string} comma separated rgb values
69
+ */
70
+ /**
71
+ * Long content fade mixin
72
+ *
73
+ * Creates a fading overlay to signify that the content is longer
74
+ * than the space allows.
75
+ */
76
+ /**
77
+ * Typography
78
+ */
79
+ /**
80
+ * Breakpoint mixins
81
+ */
82
+ /**
83
+ * Focus styles.
84
+ */
85
+ /**
86
+ * Applies editor left position to the selector passed as argument
87
+ */
88
+ /**
89
+ * Styles that are reused verbatim in a few places
90
+ */
91
+ /**
92
+ * Allows users to opt-out of animations via OS-level preferences.
93
+ */
94
+ /**
95
+ * Reset default styles for JavaScript UI based pages.
96
+ * This is a WP-admin agnostic reset
97
+ */
98
+ /**
99
+ * Reset the WP Admin page styles for Gutenberg-like pages.
100
+ */
101
+ :root {
102
+ --wp-admin-theme-color: #007cba;
103
+ --wp-admin-theme-color--rgb: 0, 124, 186;
104
+ --wp-admin-theme-color-darker-10: #006ba1;
105
+ --wp-admin-theme-color-darker-10--rgb: 0, 107, 161;
106
+ --wp-admin-theme-color-darker-20: #005a87;
107
+ --wp-admin-theme-color-darker-20--rgb: 0, 90, 135;
108
+ --wp-admin-border-width-focus: 2px;
109
+ --wp-block-synced-color: #7a00df;
110
+ --wp-block-synced-color--rgb: 122, 0, 223;
111
+ --wp-bound-block-color: var(--wp-block-synced-color);
112
+ }
113
+ @media (min-resolution: 192dpi) {
114
+ :root {
115
+ --wp-admin-border-width-focus: 1.5px;
116
+ }
117
+ }
118
+
119
+ .fields-controls__slug .fields-controls__slug-external-icon {
120
+ margin-right: 5ch;
121
+ }
122
+ .fields-controls__slug .fields-controls__slug-input input.components-input-control__input {
123
+ padding-inline-start: 0 !important;
124
+ }
125
+ .fields-controls__slug .fields-controls__slug-help-link {
126
+ word-break: break-word;
127
+ }
128
+ .fields-controls__slug .fields-controls__slug-help {
129
+ display: flex;
130
+ flex-direction: column;
131
+ }
132
+ .fields-controls__slug .fields-controls__slug-help .fields-controls__slug-help-slug {
133
+ font-weight: 600;
134
+ }
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Converts a hex value into the rgb equivalent.
3
+ *
4
+ * @param {string} hex - the hexadecimal value to convert
5
+ * @return {string} comma separated rgb values
6
+ */
7
+ /**
8
+ * Colors
9
+ */
10
+ /**
11
+ * Breakpoints & Media Queries
12
+ */
13
+ /**
14
+ * SCSS Variables.
15
+ *
16
+ * Please use variables from this sheet to ensure consistency across the UI.
17
+ * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
18
+ * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
19
+ */
20
+ /**
21
+ * Converts a hex value into the rgb equivalent.
22
+ *
23
+ * @param {string} hex - the hexadecimal value to convert
24
+ * @return {string} comma separated rgb values
25
+ */
26
+ /**
27
+ * Colors
28
+ */
29
+ /**
30
+ * Fonts & basic variables.
31
+ */
32
+ /**
33
+ * Typography
34
+ */
35
+ /**
36
+ * Grid System.
37
+ * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
38
+ */
39
+ /**
40
+ * Radius scale.
41
+ */
42
+ /**
43
+ * Elevation scale.
44
+ */
45
+ /**
46
+ * Dimensions.
47
+ */
48
+ /**
49
+ * Mobile specific styles
50
+ */
51
+ /**
52
+ * Editor styles.
53
+ */
54
+ /**
55
+ * Block & Editor UI.
56
+ */
57
+ /**
58
+ * Block paddings.
59
+ */
60
+ /**
61
+ * React Native specific.
62
+ * These variables do not appear to be used anywhere else.
63
+ */
64
+ /**
65
+ * Converts a hex value into the rgb equivalent.
66
+ *
67
+ * @param {string} hex - the hexadecimal value to convert
68
+ * @return {string} comma separated rgb values
69
+ */
70
+ /**
71
+ * Long content fade mixin
72
+ *
73
+ * Creates a fading overlay to signify that the content is longer
74
+ * than the space allows.
75
+ */
76
+ /**
77
+ * Typography
78
+ */
79
+ /**
80
+ * Breakpoint mixins
81
+ */
82
+ /**
83
+ * Focus styles.
84
+ */
85
+ /**
86
+ * Applies editor left position to the selector passed as argument
87
+ */
88
+ /**
89
+ * Styles that are reused verbatim in a few places
90
+ */
91
+ /**
92
+ * Allows users to opt-out of animations via OS-level preferences.
93
+ */
94
+ /**
95
+ * Reset default styles for JavaScript UI based pages.
96
+ * This is a WP-admin agnostic reset
97
+ */
98
+ /**
99
+ * Reset the WP Admin page styles for Gutenberg-like pages.
100
+ */
101
+ :root {
102
+ --wp-admin-theme-color: #007cba;
103
+ --wp-admin-theme-color--rgb: 0, 124, 186;
104
+ --wp-admin-theme-color-darker-10: #006ba1;
105
+ --wp-admin-theme-color-darker-10--rgb: 0, 107, 161;
106
+ --wp-admin-theme-color-darker-20: #005a87;
107
+ --wp-admin-theme-color-darker-20--rgb: 0, 90, 135;
108
+ --wp-admin-border-width-focus: 2px;
109
+ --wp-block-synced-color: #7a00df;
110
+ --wp-block-synced-color--rgb: 122, 0, 223;
111
+ --wp-bound-block-color: var(--wp-block-synced-color);
112
+ }
113
+ @media (min-resolution: 192dpi) {
114
+ :root {
115
+ --wp-admin-border-width-focus: 1.5px;
116
+ }
117
+ }
118
+
119
+ .fields-controls__slug .fields-controls__slug-external-icon {
120
+ margin-left: 5ch;
121
+ }
122
+ .fields-controls__slug .fields-controls__slug-input input.components-input-control__input {
123
+ padding-inline-start: 0 !important;
124
+ }
125
+ .fields-controls__slug .fields-controls__slug-help-link {
126
+ word-break: break-word;
127
+ }
128
+ .fields-controls__slug .fields-controls__slug-help {
129
+ display: flex;
130
+ flex-direction: column;
131
+ }
132
+ .fields-controls__slug .fields-controls__slug-help .fields-controls__slug-help-slug {
133
+ font-weight: 600;
134
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"delete-post.d.ts","sourceRoot":"","sources":["../../src/actions/delete-post.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAWnD,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAUhE,QAAA,MAAM,gBAAgB,EAAE,MAAM,CAAE,QAAQ,GAAG,YAAY,GAAG,OAAO,CAqKhE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"delete-post.d.ts","sourceRoot":"","sources":["../../src/actions/delete-post.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAWnD,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAUhE,QAAA,MAAM,gBAAgB,EAAE,MAAM,CAAE,QAAQ,GAAG,YAAY,GAAG,OAAO,CAwKhE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { DataFormControlProps } from '@wordpress/dataviews';
2
+ /**
3
+ * Internal dependencies
4
+ */
5
+ import type { BasePost } from '../../types';
6
+ export declare const FeaturedImageEdit: ({ data, field, onChange, }: DataFormControlProps<BasePost>) => import("react").JSX.Element;
7
+ //# sourceMappingURL=featured-image-edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"featured-image-edit.d.ts","sourceRoot":"","sources":["../../../src/fields/featured-image/featured-image-edit.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,eAAO,MAAM,iBAAiB,+BAI3B,oBAAoB,CAAE,QAAQ,CAAE,gCAoGlC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { BasePost } from '../../types';
5
+ import type { DataViewRenderFieldProps } from '@wordpress/dataviews';
6
+ export declare const FeaturedImageView: ({ item, }: DataViewRenderFieldProps<BasePost>) => import("react").JSX.Element;
7
+ //# sourceMappingURL=featured-image-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"featured-image-view.d.ts","sourceRoot":"","sources":["../../../src/fields/featured-image/featured-image-view.tsx"],"names":[],"mappings":"AAMA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE,eAAO,MAAM,iBAAiB,cAE3B,wBAAwB,CAAE,QAAQ,CAAE,gCAuBtC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import type { Field } from '@wordpress/dataviews';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+ import type { BasePost } from '../../types';
9
+ declare const featuredImageField: Field<BasePost>;
10
+ export default featuredImageField;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/featured-image/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK5C,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAE,QAAQ,CAQxC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1,3 +1,6 @@
1
+ export { default as slugField } from './slug';
1
2
  export { default as titleField } from './title';
2
3
  export { default as orderField } from './order';
4
+ export { default as featuredImageField } from './featured-image';
5
+ export { default as parentField } from './parent';
3
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fields/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fields/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import type { Field } from '@wordpress/dataviews';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+ import type { BasePost } from '../../types';
9
+ declare const parentField: Field<BasePost>;
10
+ /**
11
+ * This field is used to display the post parent.
12
+ */
13
+ export default parentField;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/parent/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK5C,QAAA,MAAM,WAAW,EAAE,KAAK,CAAE,QAAQ,CAQjC,CAAC;AAEF;;GAEG;AACH,eAAe,WAAW,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { DataFormControlProps } from '@wordpress/dataviews';
2
+ import type { BasePost } from '../../types';
3
+ export declare const getItemPriority: (name: string, searchValue: string) => number;
4
+ export declare function PageAttributesParent({ data, onChangeControl, }: {
5
+ data: BasePost;
6
+ onChangeControl: (newValue: number) => void;
7
+ }): import("react").JSX.Element | null;
8
+ export declare const ParentEdit: ({ data, field, onChange, }: DataFormControlProps<BasePost>) => import("react").JSX.Element;
9
+ //# sourceMappingURL=parent-edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parent-edit.d.ts","sourceRoot":"","sources":["../../../src/fields/parent/parent-edit.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAajE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAqE5C,eAAO,MAAM,eAAe,SAAW,MAAM,eAAe,MAAM,WAYjE,CAAC;AAEF,wBAAgB,oBAAoB,CAAE,EACrC,IAAI,EACJ,eAAe,GACf,EAAE;IACF,IAAI,EAAE,QAAQ,CAAC;IACf,eAAe,EAAE,CAAE,QAAQ,EAAE,MAAM,KAAM,IAAI,CAAC;CAC9C,sCAsKA;AAED,eAAO,MAAM,UAAU,+BAIpB,oBAAoB,CAAE,QAAQ,CAAE,gCA4DlC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { BasePost } from '../../types';
5
+ import type { DataViewRenderFieldProps } from '@wordpress/dataviews';
6
+ export declare const ParentView: ({ item, }: DataViewRenderFieldProps<BasePost>) => import("react").JSX.Element;
7
+ //# sourceMappingURL=parent-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parent-view.d.ts","sourceRoot":"","sources":["../../../src/fields/parent/parent-view.tsx"],"names":[],"mappings":"AAMA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAIrE,eAAO,MAAM,UAAU,cAEpB,wBAAwB,CAAE,QAAQ,CAAE,gCAgBtC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { BasePost } from '../../types';
5
+ export declare function getTitleWithFallbackName(post: BasePost): string;
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/fields/parent/utils.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,wBAAgB,wBAAwB,CAAE,IAAI,EAAE,QAAQ,UAMvD"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import type { Field } from '@wordpress/dataviews';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+ import type { BasePost } from '../../types';
9
+ declare const slugField: Field<BasePost>;
10
+ export default slugField;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/slug/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK5C,QAAA,MAAM,SAAS,EAAE,KAAK,CAAE,QAAQ,CAO/B,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { DataFormControlProps } from '@wordpress/dataviews';
2
+ /**
3
+ * Internal dependencies
4
+ */
5
+ import type { BasePost } from '../../types';
6
+ declare const SlugEdit: ({ field, onChange, data, }: DataFormControlProps<BasePost>) => import("react").JSX.Element;
7
+ export default SlugEdit;
8
+ //# sourceMappingURL=slug-edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slug-edit.d.ts","sourceRoot":"","sources":["../../../src/fields/slug/slug-edit.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAGjE;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,QAAA,MAAM,QAAQ,+BAIX,oBAAoB,CAAE,QAAQ,CAAE,gCA6HlC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { BasePost } from '../../types';
5
+ declare const SlugView: ({ item }: {
6
+ item: BasePost;
7
+ }) => string;
8
+ export default SlugView;
9
+ //# sourceMappingURL=slug-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slug-view.d.ts","sourceRoot":"","sources":["../../../src/fields/slug/slug-view.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,QAAA,MAAM,QAAQ,aAAe;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,WAa9C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -43,6 +43,8 @@ export interface BasePost extends CommonPost {
43
43
  menu_order?: number;
44
44
  ping_status?: 'open' | 'closed';
45
45
  link?: string;
46
+ slug?: string;
47
+ permalink_template?: string;
46
48
  }
47
49
  export interface Template extends CommonPost {
48
50
  type: 'wp_template';
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,GACZ,WAAW,GACX,OAAO,GACP,SAAS,GACT,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,OAAO,CAAC;AAEX,MAAM,WAAW,UAAU;IAC1B,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,OAAO,EAAE,MAAM,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,KAAK,CAAC;CACf;AAED,UAAU,KAAK;IACd,qBAAqB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvD,iBAAiB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtD,CAAE,GAAG,EAAE,MAAM,GAAI;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,GAAG,SAAS,C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YAAa,SAAQ,UAAU;IAC/C,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,OAAO,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,OAAQ,SAAQ,UAAU;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACvB,sBAAsB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEhE,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG;IACxC,WAAW,EAAE;QACZ,MAAM,EAAE,OAAO,CAAC;QAChB,MAAM,EAAE,OAAO,CAAC;KAChB,CAAC;CACF,CAAC;AAEF,MAAM,WAAW,QAAQ;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE;QACV,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,SAAS,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CACF;AAGD,MAAM,MAAM,aAAa,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/fields",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "DataViews is a component that provides an API to render datasets using different types of layouts (table, grid, list, etc.).",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -32,27 +32,30 @@
32
32
  ],
33
33
  "dependencies": {
34
34
  "@babel/runtime": "7.25.7",
35
- "@wordpress/api-fetch": "^7.10.0",
36
- "@wordpress/blob": "^4.10.0",
37
- "@wordpress/blocks": "^13.10.0",
38
- "@wordpress/components": "^28.10.0",
39
- "@wordpress/compose": "^7.10.0",
40
- "@wordpress/core-data": "^7.10.0",
41
- "@wordpress/data": "^10.10.0",
42
- "@wordpress/dataviews": "^4.6.0",
43
- "@wordpress/element": "^6.10.0",
44
- "@wordpress/hooks": "^4.10.0",
45
- "@wordpress/html-entities": "^4.10.0",
46
- "@wordpress/i18n": "^5.10.0",
47
- "@wordpress/icons": "^10.10.0",
48
- "@wordpress/notices": "^5.10.0",
49
- "@wordpress/patterns": "^2.10.0",
50
- "@wordpress/primitives": "^4.10.0",
51
- "@wordpress/private-apis": "^1.10.0",
52
- "@wordpress/url": "^4.10.0",
53
- "@wordpress/warning": "^3.10.0",
35
+ "@wordpress/api-fetch": "*",
36
+ "@wordpress/blob": "*",
37
+ "@wordpress/blocks": "*",
38
+ "@wordpress/components": "*",
39
+ "@wordpress/compose": "*",
40
+ "@wordpress/core-data": "*",
41
+ "@wordpress/data": "*",
42
+ "@wordpress/dataviews": "*",
43
+ "@wordpress/element": "*",
44
+ "@wordpress/hooks": "*",
45
+ "@wordpress/html-entities": "*",
46
+ "@wordpress/i18n": "*",
47
+ "@wordpress/icons": "*",
48
+ "@wordpress/media-utils": "*",
49
+ "@wordpress/notices": "*",
50
+ "@wordpress/patterns": "*",
51
+ "@wordpress/primitives": "*",
52
+ "@wordpress/private-apis": "*",
53
+ "@wordpress/router": "*",
54
+ "@wordpress/url": "*",
55
+ "@wordpress/warning": "*",
54
56
  "change-case": "4.1.2",
55
- "client-zip": "^2.4.5"
57
+ "client-zip": "^2.4.5",
58
+ "remove-accents": "^0.5.0"
56
59
  },
57
60
  "peerDependencies": {
58
61
  "react": "^18.0.0"
@@ -60,5 +63,6 @@
60
63
  "publishConfig": {
61
64
  "access": "public"
62
65
  },
63
- "gitHead": "ab34a7ac935fd1478eac63b596242d83270897ee"
66
+ "wpScript": true,
67
+ "gitHead": "dcf4613b33b0eda14e203ac30f700ed0db70347f"
64
68
  }
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { trash } from '@wordpress/icons';
5
- import { __, _n, sprintf } from '@wordpress/i18n';
5
+ import { __, _x, _n, sprintf } from '@wordpress/i18n';
6
6
  import { useState } from '@wordpress/element';
7
7
  import {
8
8
  Button,
@@ -66,8 +66,8 @@ const deletePostAction: Action< Template | TemplatePart | Pattern > = {
66
66
  items.length
67
67
  )
68
68
  : sprintf(
69
- // translators: %s: The template or template part's titles
70
- __( 'Delete "%s"?' ),
69
+ // translators: %s: The template or template part's title
70
+ _x( 'Delete "%s"?', 'template part' ),
71
71
  getItemTitle( items[ 0 ] )
72
72
  ) }
73
73
  </Text>
@@ -100,8 +100,11 @@ const deletePostAction: Action< Template | TemplatePart | Pattern > = {
100
100
  )
101
101
  )
102
102
  : sprintf(
103
- /* translators: The template/part's name. */
104
- __( '"%s" deleted.' ),
103
+ /* translators: %s: The template/part's name. */
104
+ _x(
105
+ '"%s" deleted.',
106
+ 'template part'
107
+ ),
105
108
  decodeEntities(
106
109
  getItemTitle( item )
107
110
  )
@@ -38,7 +38,7 @@ const duplicatePost: Action< BasePost > = {
38
38
  ...items[ 0 ],
39
39
  title: sprintf(
40
40
  /* translators: %s: Existing template title */
41
- __( '%s (Copy)' ),
41
+ _x( '%s (Copy)', 'template' ),
42
42
  getItemTitle( items[ 0 ] )
43
43
  ),
44
44
  } );
@@ -104,7 +104,7 @@ const duplicatePost: Action< BasePost > = {
104
104
 
105
105
  createSuccessNotice(
106
106
  sprintf(
107
- // translators: %s: Title of the created template e.g: "Category".
107
+ // translators: %s: Title of the created post or template, e.g: "Hello world".
108
108
  __( '"%s" successfully created.' ),
109
109
  decodeEntities( newItem.title?.rendered || item.title )
110
110
  ),
@@ -17,7 +17,7 @@ const viewPostRevisions: Action< Post > = {
17
17
  const revisionsCount =
18
18
  items[ 0 ]._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;
19
19
  return sprintf(
20
- /* translators: %s: number of revisions */
20
+ /* translators: %s: number of revisions. */
21
21
  __( 'View revisions (%s)' ),
22
22
  revisionsCount
23
23
  );