Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 馃幐 Add support for global symbols in gen 2 sdks #2397

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/sdks/src/blocks/symbol/symbol.lite.tsx
Expand Up @@ -14,6 +14,7 @@ export interface SymbolInfo {
content?: BuilderContent;
inline?: boolean;
dynamic?: boolean;
ownerId?: string;
}

export interface SymbolProps {
Expand Down Expand Up @@ -60,7 +61,7 @@ export default function Symbol(props: SymbolProps) {
) {
getContent({
model: props.symbol.model,
apiKey: builderContext.value.apiKey,
apiKey: props.symbol.ownerId || builderContext.value.apiKey,
apiVersion: builderContext.value.apiVersion,
query: {
id: props.symbol.entry,
Expand Down Expand Up @@ -94,7 +95,7 @@ export default function Symbol(props: SymbolProps) {
>
<RenderContent
apiVersion={builderContext.value.apiVersion}
apiKey={builderContext.value.apiKey!}
apiKey={props.symbol?.ownerId || builderContext.value.apiKey!}
context={builderContext.value.context}
customComponents={Object.values(
builderContext.value.registeredComponents
Expand Down
1 change: 1 addition & 0 deletions packages/sdks/src/scripts/init-editing.ts
Expand Up @@ -51,6 +51,7 @@ export const setupBrowserForEditing = (
// scope our '+ add block' button styling
supportsAddBlockScoping: true,
supportsCustomBreakpoints: true,
supportsGlobalSymbols: true,
},
},
'*'
Expand Down