@wordpress/block-library
Version:
Block library for the WordPress editor.
8 lines (7 loc) • 1.85 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../src/gallery/variations.js"],
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { ATTACHED_MEDIA } from './dynamic-source';\n\nconst variations = [\n\t{\n\t\tname: 'dynamic-gallery',\n\t\ttitle: __( 'Dynamic Gallery' ),\n\t\tdescription: __(\n\t\t\t'Display images from a source, such as those attached to the current post.'\n\t\t),\n\t\tattributes: {\n\t\t\tdynamicContent: { source: ATTACHED_MEDIA },\n\t\t},\n\t\t// Match any gallery that has a dynamic source configured, regardless of\n\t\t// the specific source or options, so the variation's title and\n\t\t// description describe the block whenever it runs in dynamic mode.\n\t\tisActive: ( blockAttributes ) => !! blockAttributes.dynamicContent,\n\t\t// No scopes for now. While dynamic mode only supports the \"attached to the\n\t\t// current post\" source, `'inserter'` is intentionally omitted: a dedicated\n\t\t// inserter entry would surface in post-less contexts (templates, template\n\t\t// parts, synced patterns) where there's no post to resolve images from. The\n\t\t// entry point is instead the inspector toggle on a regular Gallery.\n\t\t// `isActive` still relabels the block card to \"Dynamic Gallery\" regardless\n\t\t// of scope. Revisit adding `'inserter'` in a follow-up as the feature grows\n\t\t// beyond the post-attached source.\n\t\tscope: [],\n\t},\n];\n\nexport default variations;\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,4BAA+B;AAE/B,IAAM,aAAa;AAAA,EAClB;AAAA,IACC,MAAM;AAAA,IACN,WAAO,gBAAI,iBAAkB;AAAA,IAC7B,iBAAa;AAAA,MACZ;AAAA,IACD;AAAA,IACA,YAAY;AAAA,MACX,gBAAgB,EAAE,QAAQ,qCAAe;AAAA,IAC1C;AAAA;AAAA;AAAA;AAAA,IAIA,UAAU,CAAE,oBAAqB,CAAC,CAAE,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASpD,OAAO,CAAC;AAAA,EACT;AACD;AAEA,IAAO,qBAAQ;",
"names": []
}