@wix/blog 1.0.690 → 1.0.692
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/_sdk-exports/context-blog-feed-context-provider/runtime.d.ts +483 -0
- package/_sdk-exports/context-blog-feed-context-provider/runtime.js +5 -0
- package/_sdk-exports/context-category-item-context-provider/runtime.d.ts +189 -0
- package/_sdk-exports/context-category-item-context-provider/runtime.js +2 -0
- package/_sdk-exports/context-post-by-id-context-provider/runtime.d.ts +31 -0
- package/_sdk-exports/context-post-by-id-context-provider/runtime.js +5 -0
- package/_sdk-exports/context-post-context-provider/runtime.d.ts +3213 -0
- package/_sdk-exports/context-post-context-provider/runtime.js +5 -0
- package/_sdk-exports/context-post-item-context-provider/runtime.d.ts +386 -0
- package/_sdk-exports/context-post-item-context-provider/runtime.js +5 -0
- package/_sdk-exports/context-related-posts-context-provider/runtime.d.ts +341 -0
- package/_sdk-exports/context-related-posts-context-provider/runtime.js +5 -0
- package/_sdk-exports/context-tag-item-context-provider/runtime.d.ts +185 -0
- package/_sdk-exports/context-tag-item-context-provider/runtime.js +2 -0
- package/blog-feed-context-provider/package.json +3 -0
- package/build/cjs/context-blog-feed-context-provider.d.ts +483 -0
- package/build/cjs/context-blog-feed-context-provider.js +4601 -0
- package/build/cjs/context-blog-feed-context-provider.js.map +1 -0
- package/build/cjs/context-category-item-context-provider.d.ts +189 -0
- package/build/cjs/context-category-item-context-provider.js +578 -0
- package/build/cjs/context-category-item-context-provider.js.map +1 -0
- package/build/cjs/context-post-by-id-context-provider.d.ts +31 -0
- package/build/cjs/context-post-by-id-context-provider.js +4531 -0
- package/build/cjs/context-post-by-id-context-provider.js.map +1 -0
- package/build/cjs/context-post-context-provider.d.ts +3213 -0
- package/build/cjs/context-post-context-provider.js +5404 -0
- package/build/cjs/context-post-context-provider.js.map +1 -0
- package/build/cjs/context-post-item-context-provider.d.ts +386 -0
- package/build/cjs/context-post-item-context-provider.js +3682 -0
- package/build/cjs/context-post-item-context-provider.js.map +1 -0
- package/build/cjs/context-related-posts-context-provider.d.ts +341 -0
- package/build/cjs/context-related-posts-context-provider.js +4355 -0
- package/build/cjs/context-related-posts-context-provider.js.map +1 -0
- package/build/cjs/context-tag-item-context-provider.d.ts +185 -0
- package/build/cjs/context-tag-item-context-provider.js +578 -0
- package/build/cjs/context-tag-item-context-provider.js.map +1 -0
- package/build/es/context-blog-feed-context-provider.d.mts +483 -0
- package/build/es/context-blog-feed-context-provider.mjs +4571 -0
- package/build/es/context-blog-feed-context-provider.mjs.map +1 -0
- package/build/es/context-category-item-context-provider.d.mts +189 -0
- package/build/es/context-category-item-context-provider.mjs +549 -0
- package/build/es/context-category-item-context-provider.mjs.map +1 -0
- package/build/es/context-post-by-id-context-provider.d.mts +31 -0
- package/build/es/context-post-by-id-context-provider.mjs +4491 -0
- package/build/es/context-post-by-id-context-provider.mjs.map +1 -0
- package/build/es/context-post-context-provider.d.mts +3213 -0
- package/build/es/context-post-context-provider.mjs +5374 -0
- package/build/es/context-post-context-provider.mjs.map +1 -0
- package/build/es/context-post-item-context-provider.d.mts +386 -0
- package/build/es/context-post-item-context-provider.mjs +3652 -0
- package/build/es/context-post-item-context-provider.mjs.map +1 -0
- package/build/es/context-related-posts-context-provider.d.mts +341 -0
- package/build/es/context-related-posts-context-provider.mjs +4325 -0
- package/build/es/context-related-posts-context-provider.mjs.map +1 -0
- package/build/es/context-tag-item-context-provider.d.mts +185 -0
- package/build/es/context-tag-item-context-provider.mjs +549 -0
- package/build/es/context-tag-item-context-provider.mjs.map +1 -0
- package/build/internal/cjs/context-blog-feed-context-provider.d.ts +483 -0
- package/build/internal/cjs/context-category-item-context-provider.d.ts +189 -0
- package/build/internal/cjs/context-post-by-id-context-provider.d.ts +31 -0
- package/build/internal/cjs/context-post-context-provider.d.ts +3213 -0
- package/build/internal/cjs/context-post-item-context-provider.d.ts +386 -0
- package/build/internal/cjs/context-related-posts-context-provider.d.ts +341 -0
- package/build/internal/cjs/context-tag-item-context-provider.d.ts +185 -0
- package/build/internal/es/context-blog-feed-context-provider.d.mts +483 -0
- package/build/internal/es/context-category-item-context-provider.d.mts +189 -0
- package/build/internal/es/context-post-by-id-context-provider.d.mts +31 -0
- package/build/internal/es/context-post-context-provider.d.mts +3213 -0
- package/build/internal/es/context-post-item-context-provider.d.mts +386 -0
- package/build/internal/es/context-related-posts-context-provider.d.mts +341 -0
- package/build/internal/es/context-tag-item-context-provider.d.mts +185 -0
- package/category-item-context-provider/package.json +3 -0
- package/context/blog-feed-context-provider/package.json +3 -0
- package/context/category-item-context-provider/package.json +3 -0
- package/context/post-by-id-context-provider/package.json +3 -0
- package/context/post-context-provider/package.json +3 -0
- package/context/post-item-context-provider/package.json +3 -0
- package/context/related-posts-context-provider/package.json +3 -0
- package/context/tag-item-context-provider/package.json +3 -0
- package/package.json +104 -5
- package/post-by-id-context-provider/package.json +3 -0
- package/post-context-provider/package.json +3 -0
- package/post-item-context-provider/package.json +3 -0
- package/related-posts-context-provider/package.json +3 -0
- package/tag-item-context-provider/package.json +3 -0
|
@@ -0,0 +1,189 @@
|
|
|
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
|
+
/**
|
|
134
|
+
* One item of the `postCategories` array — the object the platform hands the Category Item
|
|
135
|
+
* context provider as its `categoryData` prop (via the manifest's `contextImplementor`).
|
|
136
|
+
*
|
|
137
|
+
* `_id`/`label` are the manifest contract (`CATEGORY_ITEM_CONTRACT_ITEMS`, plain text and
|
|
138
|
+
* non-bindable); the remaining keys must match the Category Item context manifest's
|
|
139
|
+
* `context.items` keys, because the runtime resolves an element's binding by looking the
|
|
140
|
+
* key up on that provider's hook return value.
|
|
141
|
+
*/
|
|
142
|
+
interface PostCategoryItem {
|
|
143
|
+
/** Repeater item identity; also the manifest contract's `_id`. */
|
|
144
|
+
_id: string;
|
|
145
|
+
/** The manifest contract's `label` (plain text, non-bindable — see the richText label below). */
|
|
146
|
+
label: string;
|
|
147
|
+
itemCategoryLabel: RichText;
|
|
148
|
+
/** The category's feed view; `undefined` (unlinked) without a resolvable base or slug. */
|
|
149
|
+
itemCategoryLink: Link | undefined;
|
|
150
|
+
/** Mirrors the Category Item manifest's nested (non-bindable) `categoryItem` data item. */
|
|
151
|
+
categoryItem: {
|
|
152
|
+
label: string;
|
|
153
|
+
slug: string;
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/extensions/category-item-context-provider/category-item-context-provider.d.ts
|
|
158
|
+
/**
|
|
159
|
+
* The context value IS the item — its keys sit top-level because the runtime resolves an
|
|
160
|
+
* element's binding by looking the manifest item key up on this hook's return value
|
|
161
|
+
* (through `contextSpecifier.hook`).
|
|
162
|
+
*
|
|
163
|
+
* Unlike the Post Item context there is nothing to derive per cell: a category chip has no
|
|
164
|
+
* per-cell network read, so the item the platform injects is published unchanged and no
|
|
165
|
+
* memo is needed (the object identity is the platform's, stable per cell render).
|
|
166
|
+
*/
|
|
167
|
+
type CategoryItemContextType = PostCategoryItem;
|
|
168
|
+
/**
|
|
169
|
+
* Nullable rather than throwing: the hook runs for every element inside the repeater cell,
|
|
170
|
+
* including on the editor stage before the cell is populated.
|
|
171
|
+
*/
|
|
172
|
+
declare function useCategoryItemContext(): CategoryItemContextType | null;
|
|
173
|
+
/** Props accepted by {@link CategoryItemContextProvider}. */
|
|
174
|
+
interface CategoryItemContextProviderProps extends React.PropsWithChildren {
|
|
175
|
+
/**
|
|
176
|
+
* The current item of the `postCategories` array, injected by the platform per repeater
|
|
177
|
+
* cell (the Post context manifest's `contextImplementor.propKey`). Absent on the editor's
|
|
178
|
+
* unbound template cell — children then render over a null context, matching the Post
|
|
179
|
+
* Item provider; this provider has no standalone fetch path.
|
|
180
|
+
*/
|
|
181
|
+
categoryData?: PostCategoryItem;
|
|
182
|
+
}
|
|
183
|
+
/** Supplies one post category, injected per repeater cell, to its children. */
|
|
184
|
+
declare function CategoryItemContextProvider({
|
|
185
|
+
categoryData,
|
|
186
|
+
children
|
|
187
|
+
}: CategoryItemContextProviderProps): React.ReactNode;
|
|
188
|
+
|
|
189
|
+
export { CategoryItemContextProvider, type CategoryItemContextProviderProps, type CategoryItemContextType, type PostCategoryItem, CategoryItemContextProvider as default, useCategoryItemContext };
|