@wix/blog 1.0.691 → 1.0.693

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 (85) hide show
  1. package/_sdk-exports/context-blog-feed-context-provider/runtime.d.ts +664 -0
  2. package/_sdk-exports/context-blog-feed-context-provider/runtime.js +5 -0
  3. package/_sdk-exports/context-category-item-context-provider/runtime.d.ts +188 -0
  4. package/_sdk-exports/context-category-item-context-provider/runtime.js +2 -0
  5. package/_sdk-exports/context-post-by-id-context-provider/runtime.d.ts +31 -0
  6. package/_sdk-exports/context-post-by-id-context-provider/runtime.js +5 -0
  7. package/_sdk-exports/context-post-context-provider/runtime.d.ts +3389 -0
  8. package/_sdk-exports/context-post-context-provider/runtime.js +5 -0
  9. package/_sdk-exports/context-post-item-context-provider/runtime.d.ts +509 -0
  10. package/_sdk-exports/context-post-item-context-provider/runtime.js +5 -0
  11. package/_sdk-exports/context-related-posts-context-provider/runtime.d.ts +437 -0
  12. package/_sdk-exports/context-related-posts-context-provider/runtime.js +5 -0
  13. package/_sdk-exports/context-tag-item-context-provider/runtime.d.ts +186 -0
  14. package/_sdk-exports/context-tag-item-context-provider/runtime.js +2 -0
  15. package/blog-feed-context-provider/package.json +3 -0
  16. package/build/cjs/context-blog-feed-context-provider.d.ts +664 -0
  17. package/build/cjs/context-blog-feed-context-provider.js +4601 -0
  18. package/build/cjs/context-blog-feed-context-provider.js.map +1 -0
  19. package/build/cjs/context-category-item-context-provider.d.ts +188 -0
  20. package/build/cjs/context-category-item-context-provider.js +578 -0
  21. package/build/cjs/context-category-item-context-provider.js.map +1 -0
  22. package/build/cjs/context-post-by-id-context-provider.d.ts +31 -0
  23. package/build/cjs/context-post-by-id-context-provider.js +4531 -0
  24. package/build/cjs/context-post-by-id-context-provider.js.map +1 -0
  25. package/build/cjs/context-post-context-provider.d.ts +3389 -0
  26. package/build/cjs/context-post-context-provider.js +5404 -0
  27. package/build/cjs/context-post-context-provider.js.map +1 -0
  28. package/build/cjs/context-post-item-context-provider.d.ts +509 -0
  29. package/build/cjs/context-post-item-context-provider.js +3682 -0
  30. package/build/cjs/context-post-item-context-provider.js.map +1 -0
  31. package/build/cjs/context-related-posts-context-provider.d.ts +437 -0
  32. package/build/cjs/context-related-posts-context-provider.js +4355 -0
  33. package/build/cjs/context-related-posts-context-provider.js.map +1 -0
  34. package/build/cjs/context-tag-item-context-provider.d.ts +186 -0
  35. package/build/cjs/context-tag-item-context-provider.js +578 -0
  36. package/build/cjs/context-tag-item-context-provider.js.map +1 -0
  37. package/build/es/context-blog-feed-context-provider.d.mts +664 -0
  38. package/build/es/context-blog-feed-context-provider.mjs +4571 -0
  39. package/build/es/context-blog-feed-context-provider.mjs.map +1 -0
  40. package/build/es/context-category-item-context-provider.d.mts +188 -0
  41. package/build/es/context-category-item-context-provider.mjs +549 -0
  42. package/build/es/context-category-item-context-provider.mjs.map +1 -0
  43. package/build/es/context-post-by-id-context-provider.d.mts +31 -0
  44. package/build/es/context-post-by-id-context-provider.mjs +4491 -0
  45. package/build/es/context-post-by-id-context-provider.mjs.map +1 -0
  46. package/build/es/context-post-context-provider.d.mts +3389 -0
  47. package/build/es/context-post-context-provider.mjs +5374 -0
  48. package/build/es/context-post-context-provider.mjs.map +1 -0
  49. package/build/es/context-post-item-context-provider.d.mts +509 -0
  50. package/build/es/context-post-item-context-provider.mjs +3652 -0
  51. package/build/es/context-post-item-context-provider.mjs.map +1 -0
  52. package/build/es/context-related-posts-context-provider.d.mts +437 -0
  53. package/build/es/context-related-posts-context-provider.mjs +4325 -0
  54. package/build/es/context-related-posts-context-provider.mjs.map +1 -0
  55. package/build/es/context-tag-item-context-provider.d.mts +186 -0
  56. package/build/es/context-tag-item-context-provider.mjs +549 -0
  57. package/build/es/context-tag-item-context-provider.mjs.map +1 -0
  58. package/build/internal/cjs/context-blog-feed-context-provider.d.ts +664 -0
  59. package/build/internal/cjs/context-category-item-context-provider.d.ts +188 -0
  60. package/build/internal/cjs/context-post-by-id-context-provider.d.ts +31 -0
  61. package/build/internal/cjs/context-post-context-provider.d.ts +3389 -0
  62. package/build/internal/cjs/context-post-item-context-provider.d.ts +509 -0
  63. package/build/internal/cjs/context-related-posts-context-provider.d.ts +437 -0
  64. package/build/internal/cjs/context-tag-item-context-provider.d.ts +186 -0
  65. package/build/internal/es/context-blog-feed-context-provider.d.mts +664 -0
  66. package/build/internal/es/context-category-item-context-provider.d.mts +188 -0
  67. package/build/internal/es/context-post-by-id-context-provider.d.mts +31 -0
  68. package/build/internal/es/context-post-context-provider.d.mts +3389 -0
  69. package/build/internal/es/context-post-item-context-provider.d.mts +509 -0
  70. package/build/internal/es/context-related-posts-context-provider.d.mts +437 -0
  71. package/build/internal/es/context-tag-item-context-provider.d.mts +186 -0
  72. package/category-item-context-provider/package.json +3 -0
  73. package/context/blog-feed-context-provider/package.json +3 -0
  74. package/context/category-item-context-provider/package.json +3 -0
  75. package/context/post-by-id-context-provider/package.json +3 -0
  76. package/context/post-context-provider/package.json +3 -0
  77. package/context/post-item-context-provider/package.json +3 -0
  78. package/context/related-posts-context-provider/package.json +3 -0
  79. package/context/tag-item-context-provider/package.json +3 -0
  80. package/package.json +103 -4
  81. package/post-by-id-context-provider/package.json +3 -0
  82. package/post-context-provider/package.json +3 -0
  83. package/post-item-context-provider/package.json +3 -0
  84. package/related-posts-context-provider/package.json +3 -0
  85. package/tag-item-context-provider/package.json +3 -0
@@ -0,0 +1,188 @@
1
+ import React from 'react';
2
+
3
+ //#region ../../node_modules/type-fest/source/observable-like.d.ts
4
+ declare global {
5
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
6
+ interface SymbolConstructor {
7
+ readonly observable: symbol;
8
+ }
9
+ }
10
+ /**
11
+ @remarks
12
+ The TC39 observable proposal defines a `closed` property, but some implementations (such as xstream) do not as of 10/08/2021.
13
+ As well, some guidance on making an `Observable` to not include `closed` property.
14
+ @see https://github.com/tc39/proposal-observable/blob/master/src/Observable.js#L129-L130
15
+ @see https://github.com/staltz/xstream/blob/6c22580c1d84d69773ee4b0905df44ad464955b3/src/index.ts#L79-L85
16
+ @see https://github.com/benlesh/symbol-observable#making-an-object-observable
17
+
18
+ @category Observable
19
+ */
20
+ //#endregion
21
+ //#region ../../node_modules/@wix/sdk-types/build/index.d.ts
22
+ declare global {
23
+ interface ContextualClient {}
24
+ }
25
+ /**
26
+ * Creates concrete types from SDK descriptors when a contextual client is
27
+ * available.
28
+ *
29
+ * For a REST descriptor the built (bound) API is intersected with the original
30
+ * descriptor, matching what `contextualizeRESTModuleV2` returns at runtime — a
31
+ * value callable as the bound API and still usable as a descriptor. Keeping the
32
+ * descriptor half lets contextual modules be passed to descriptor-constrained
33
+ * helpers such as `elevate` from `@wix/sdk/context` (FEDINF-14092).
34
+ *
35
+ * The `& T` is scoped to REST descriptors — the only shape codegen wraps in
36
+ * `MaybeContext` — so `BuildDescriptors` (used by `createClient().use`) is left
37
+ * unchanged and stays bound-only. The fix lives here rather than in `elevate`,
38
+ * which is kept strict on purpose (see #941) so it still rejects bound-only
39
+ * functions that are unsafe through `createRESTModule`.
40
+ */
41
+ declare global {
42
+ /**
43
+ * A global interface to set the exposure toggle for the SDK.
44
+ * @example
45
+ * ```ts
46
+ * declare global {
47
+ * interface SDKExposureToggle {
48
+ * alpha: true;
49
+ * }
50
+ * }
51
+ */
52
+ interface SDKExposureToggle {}
53
+ }
54
+ declare global {
55
+ /**
56
+ * A global interface to set the type mode for the SDK.
57
+ * @example
58
+ * ```ts
59
+ * declare global {
60
+ * interface SDKTypeMode {
61
+ * strict: true;
62
+ * }
63
+ * }
64
+ */
65
+ interface SDKTypeMode {}
66
+ }
67
+ //#endregion
68
+ //#region ../../node_modules/@wix/editor-react-types/dist/links.d.ts
69
+ type LinkTarget = '_self' | '_blank';
70
+ /**
71
+ * A link to a URL, used for navigation within components.
72
+ *
73
+ * @example
74
+ * ```tsx
75
+ * import type { Link } from '@wix/editor-react-types';
76
+ *
77
+ * interface MyComponentProps {
78
+ * link?: Link;
79
+ * }
80
+ * ```
81
+ */
82
+ type Link = {
83
+ /**
84
+ * The link URL. For partial links (see `pageRole`), this is the router prefix
85
+ * (e.g. `https://www.my-site.com/prefix`) rather than a fully resolved URL.
86
+ */
87
+ href?: string;
88
+ /**
89
+ * Where this link should open.
90
+ * - `'_self'` — opens in the same page.
91
+ * - `'_blank'` — opens in a new tab.
92
+ */
93
+ target?: LinkTarget; /** The `rel` attribute of the link. Accepts LinkRel values separated by a space. */
94
+ rel?: string;
95
+ /**
96
+ * Page role identifier. Present only on partial links, where only the router prefix is
97
+ * known and the full URL format is owned by the Router/App. Applications can use such
98
+ * links in functions to resolve the complete URL at runtime (e.g. for binding links).
99
+ * Resolved links will not have this field.
100
+ */
101
+ pageRole?: string;
102
+ };
103
+ //#endregion
104
+ //#region ../../node_modules/@wix/editor-react-types/dist/base.d.ts
105
+ /**
106
+ * Rich text content with resolved links.
107
+ *
108
+ * @example
109
+ * ```tsx
110
+ * import type { RichText } from '@wix/editor-react-types';
111
+ *
112
+ * interface MyComponentProps {
113
+ * description?: RichText;
114
+ * }
115
+ *
116
+ * const MyComponent = ({ description }: MyComponentProps) => (
117
+ * <div>
118
+ * {description?.html}
119
+ * {description?.linkList.map((link) => (
120
+ * <a key={link.href} href={link.href}>{link.href}</a>
121
+ * ))}
122
+ * </div>
123
+ * );
124
+ * ```
125
+ */
126
+ type RichText = {
127
+ /** The original rich text content. */text: string; /** The HTML content with all links resolved. */
128
+ html: string; /** All links present in the rich text content. */
129
+ linkList: Array<Link>;
130
+ };
131
+ //#endregion
132
+ //#region src/extensions/post-context-provider/utils.d.ts
133
+ /** A category the post belongs to. */
134
+ interface PostCategoryItem {
135
+ /** The category's ID. */
136
+ _id: string;
137
+ /** The category's name, as plain text. */
138
+ label: string;
139
+ /**
140
+ * The category's name, as rich text: `text` is the plain text, and `html` is an HTML
141
+ * paragraph.
142
+ */
143
+ itemCategoryLabel: RichText;
144
+ /**
145
+ * Link to the blog page that lists the category's posts, with its URL in `href`.
146
+ * `undefined` when the site has no such page.
147
+ */
148
+ itemCategoryLink: Link | undefined;
149
+ /** The category's name and slug. */
150
+ categoryItem: {
151
+ /** The category's name. */label: string; /** The category's slug, the part of its page's URL that identifies it. */
152
+ slug: string;
153
+ };
154
+ }
155
+ //#endregion
156
+ //#region src/extensions/category-item-context-provider/category-item-context-provider.d.ts
157
+ /**
158
+ * The context value IS the item — its keys sit top-level because the runtime resolves an
159
+ * element's binding by looking the manifest item key up on this hook's return value
160
+ * (through `contextSpecifier.hook`).
161
+ *
162
+ * Unlike the Post Item context there is nothing to derive per cell: a category chip has no
163
+ * per-cell network read, so the item the platform injects is published unchanged and no
164
+ * memo is needed (the object identity is the platform's, stable per cell render).
165
+ */
166
+ type CategoryItemContextType = PostCategoryItem;
167
+ /**
168
+ * Nullable rather than throwing: the hook runs for every element inside the repeater cell,
169
+ * including on the editor stage before the cell is populated.
170
+ */
171
+ declare function useCategoryItemContext(): CategoryItemContextType | null;
172
+ /** Props accepted by {@link CategoryItemContextProvider}. */
173
+ interface CategoryItemContextProviderProps extends React.PropsWithChildren {
174
+ /**
175
+ * The current item of the `postCategories` array, injected by the platform per repeater
176
+ * cell (the Post context manifest's `contextImplementor.propKey`). Absent on the editor's
177
+ * unbound template cell — children then render over a null context, matching the Post
178
+ * Item provider; this provider has no standalone fetch path.
179
+ */
180
+ categoryData?: PostCategoryItem;
181
+ }
182
+ /** Supplies one post category, injected per repeater cell, to its children. */
183
+ declare function CategoryItemContextProvider({
184
+ categoryData,
185
+ children
186
+ }: CategoryItemContextProviderProps): React.ReactNode;
187
+
188
+ export { CategoryItemContextProvider, type CategoryItemContextProviderProps, type CategoryItemContextType, type PostCategoryItem, CategoryItemContextProvider as default, useCategoryItemContext };
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ export { usePostContext as usePostByIdContext } from '@wix/blog/post-context-provider';
3
+
4
+ //#region src/lib/category-picker.d.ts
5
+ /** A WQL clause the filter picker stores for one inline field. */
6
+ type PickerClause = {
7
+ $eq?: string;
8
+ $in?: string[];
9
+ };
10
+ //#endregion
11
+ //#region src/lib/post-picker.d.ts
12
+ /** The inline filter field name, and therefore the key on the stored value. */
13
+ declare const POST_PICKER_FIELD = "postId";
14
+ interface PostPickerFilter {
15
+ [POST_PICKER_FIELD]?: PickerClause;
16
+ }
17
+ //#endregion
18
+ //#region src/extensions/post-by-id-context-provider/post-by-id-context-provider.d.ts
19
+ /** Props accepted by {@link PostByIdProvider}. */
20
+ interface PostByIdProviderProps {
21
+ children?: React.ReactNode;
22
+ /** The manifest's `data.postPicker` filter — `{ postId: { $eq: '<id>' } }` once picked. */
23
+ postPicker?: PostPickerFilter;
24
+ }
25
+ /** Supplies the blog post picked by ID through the Post context. */
26
+ declare function PostByIdProvider({
27
+ children,
28
+ postPicker
29
+ }: PostByIdProviderProps): React.ReactNode;
30
+
31
+ export { PostByIdProvider, type PostByIdProviderProps, PostByIdProvider as default };