@atlassian/clientside-extensions-components 4.0.2 → 5.1.0-5a180d69-mdyn784a
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/dist/cjs/ExtensionPoint.js +1 -1
- package/dist/cjs/ExtensionPoint.js.map +1 -1
- package/dist/cjs/ExtensionPointInfo.js +27 -20
- package/dist/cjs/ExtensionPointInfo.js.map +1 -1
- package/dist/cjs/ExtensionsObservable.js +1 -1
- package/dist/cjs/ExtensionsObservable.js.map +1 -1
- package/dist/cjs/handlers/AsyncPanelHandler.js +1 -1
- package/dist/cjs/handlers/AsyncPanelHandler.js.map +1 -1
- package/dist/cjs/handlers/ButtonHandler.js +2 -2
- package/dist/cjs/handlers/ButtonHandler.js.map +1 -1
- package/dist/cjs/handlers/LinkHandler.js +2 -2
- package/dist/cjs/handlers/LinkHandler.js.map +1 -1
- package/dist/cjs/handlers/ModalHandler.js +5 -5
- package/dist/cjs/handlers/ModalHandler.js.map +1 -1
- package/dist/cjs/handlers/PanelHandler.js +1 -1
- package/dist/cjs/handlers/PanelHandler.js.map +1 -1
- package/dist/cjs/handlers/SectionHandler.js +1 -2
- package/dist/cjs/handlers/SectionHandler.js.map +1 -1
- package/dist/cjs/index.js +10 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/renderElementAsReact.js +4 -3
- package/dist/cjs/renderElementAsReact.js.map +1 -1
- package/dist/cjs/styled.js +17 -47
- package/dist/cjs/styled.js.map +1 -1
- package/dist/cjs/types.js +1 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/useExtensions.js +1 -1
- package/dist/cjs/useExtensions.js.map +1 -1
- package/dist/cjs/useWebPanelRenderer.js.map +1 -1
- package/dist/esm/ExtensionPoint.js.map +1 -1
- package/dist/esm/ExtensionPointInfo.js +26 -19
- package/dist/esm/ExtensionPointInfo.js.map +1 -1
- package/dist/esm/ExtensionsObservable.js.map +1 -1
- package/dist/esm/handlers/AsyncPanelHandler.js.map +1 -1
- package/dist/esm/handlers/ButtonHandler.js.map +1 -1
- package/dist/esm/handlers/LinkHandler.js.map +1 -1
- package/dist/esm/handlers/ModalHandler.js +5 -5
- package/dist/esm/handlers/ModalHandler.js.map +1 -1
- package/dist/esm/handlers/PanelHandler.js.map +1 -1
- package/dist/esm/handlers/SectionHandler.js +0 -1
- package/dist/esm/handlers/SectionHandler.js.map +1 -1
- package/dist/esm/renderElementAsReact.js +3 -2
- package/dist/esm/renderElementAsReact.js.map +1 -1
- package/dist/esm/styled.js +14 -44
- package/dist/esm/styled.js.map +1 -1
- package/dist/esm/useExtensions.js.map +1 -1
- package/dist/esm/useWebPanelRenderer.js.map +1 -1
- package/dist/types/ExtensionPointInfo.d.ts +1 -1
- package/dist/types/ExtensionPointInfo.d.ts.map +1 -1
- package/dist/types/ExtensionsObservable.d.ts.map +1 -1
- package/dist/types/debug/types.d.ts +1 -1
- package/dist/types/debug/types.d.ts.map +1 -1
- package/dist/types/debug/useDebug.d.ts.map +1 -1
- package/dist/types/debug/useDiscovery.d.ts.map +1 -1
- package/dist/types/debug/useLogging.d.ts.map +1 -1
- package/dist/types/debug/useValidation.d.ts.map +1 -1
- package/dist/types/handlers/AsyncPanelHandler.d.ts +1 -1
- package/dist/types/handlers/AsyncPanelHandler.d.ts.map +1 -1
- package/dist/types/handlers/ButtonHandler.d.ts +2 -0
- package/dist/types/handlers/ButtonHandler.d.ts.map +1 -1
- package/dist/types/handlers/LinkHandler.d.ts +2 -0
- package/dist/types/handlers/LinkHandler.d.ts.map +1 -1
- package/dist/types/handlers/ModalHandler.d.ts +2 -1
- package/dist/types/handlers/ModalHandler.d.ts.map +1 -1
- package/dist/types/handlers/SectionHandler.d.ts +6 -1
- package/dist/types/handlers/SectionHandler.d.ts.map +1 -1
- package/dist/types/renderElementAsReact.d.ts +2 -1
- package/dist/types/renderElementAsReact.d.ts.map +1 -1
- package/dist/types/styled.d.ts +33 -14
- package/dist/types/styled.d.ts.map +1 -1
- package/dist/types/types.d.ts +4 -4
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/useExtensions.d.ts.map +1 -1
- package/lib/ExtensionPoint.test.tsx +1 -1
- package/lib/ExtensionPointInfo.test.tsx +1 -1
- package/lib/ExtensionPointInfo.tsx +51 -24
- package/lib/ExtensionsObservable.test.ts +1 -1
- package/lib/__snapshots__/ExtensionPointInfo.test.tsx.snap +203 -124
- package/lib/debug/useDebug.test.ts +2 -2
- package/lib/debug/useDiscovery.test.ts +2 -2
- package/lib/debug/useLogging.test.ts +2 -2
- package/lib/debug/useValidation.test.ts +2 -2
- package/lib/handlers/ButtonHandler.test.tsx +5 -1
- package/lib/handlers/ButtonHandler.tsx +3 -1
- package/lib/handlers/LinkHandler.test.tsx +5 -1
- package/lib/handlers/LinkHandler.tsx +1 -0
- package/lib/handlers/ModalHandler.test.tsx +9 -7
- package/lib/handlers/ModalHandler.tsx +11 -9
- package/lib/handlers/SectionHandler.test.tsx +1 -1
- package/lib/handlers/SectionHandler.tsx +5 -1
- package/lib/renderElementAsReact.test.tsx +7 -6
- package/lib/renderElementAsReact.tsx +12 -3
- package/lib/styled.ts +15 -46
- package/lib/useExtensions.test.ts +49 -43
- package/package.json +25 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionsObservable.js","sourceRoot":"","sources":["../../lib/ExtensionsObservable.ts"],"names":[],"mappings":"AAUA,OAAO,QAAQ,MAAM,2CAA2C,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAKtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,eAAe,GAAG,CAAC,MAAgB,EAAE,aAAqB,EAAE,QAAgB,EAAY,EAAE;IAC5F,OAAO,CAAC,GAAG,IAAe,EAAE,EAAE;QAC1B,IAAI;YACA,OAAO,MAAM,CAAC,GAAG,IAAI,CAAC,CAA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C,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,MAAM,EAAE,CAAC;YAC3C,YAAY;SACf,CAAC,CAAC;IACP,CAAC,CACJ,CAAC;IAEF,OAAO;QACH,SAAS,EAAE,CAAC,QAA+C,EAAE,EAAE;YAC3D,IAAI,iBAAiB,KAAK,SAAS,EAAE;gBACjC,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;aACxF;YAED,iBAAiB,GAAG,QAAQ,CAAC;YAC7B,0BAA0B,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YAC/C,OAAO;gBACH,WAAW,EAAE,GAAG,EAAE;oBACd,0BAA0B,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;oBAC1D,YAAY,CAAC,WAAW,EAAE,CAAC;gBAC/B,CAAC;aACJ,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import type {\n Context,\n ExtensionAPI,\n ExtensionAttributes,\n ExtensionAttributesProvider,\n ExtensionCleanupCallback,\n ExtensionDescriptor,\n MaybeOnAction,\n OnAction,\n} from '@atlassian/clientside-extensions-registry';\nimport registry from '@atlassian/clientside-extensions-registry';\nimport { onDebug } from '@atlassian/clientside-extensions-debug';\nimport type { Observable, Observer } from '@atlassian/clientside-extensions-base';\nimport { ReplaySubject } from '@atlassian/clientside-extensions-base';\n// We only import types here\n// eslint-disable-next-line node/no-unpublished-import\nimport type { Validator, ValidationError, ValidationWarning } from '@atlassian/clientside-extensions-schema';\nimport type { ExtensionPointUpdate, ExtensionState, Options } from './types';\nimport { isNotNullOrUndefined } from './types';\n\nconst safeguardAction = (action: OnAction, descriptorKey: string, location: string): OnAction => {\n return (...args: unknown[]) => {\n try {\n return action(...args);\n } catch (e) {\n onDebug(({ error }) => ({\n level: error,\n message: `Failed to execute onAction callback for extension \"${descriptorKey}\" at extension: ${location}.\n Error: ${e}`,\n meta: {\n extension: descriptorKey,\n location,\n },\n }));\n return undefined;\n }\n };\n};\n\nconst actionsCache = new Map<OnAction, OnAction>();\nconst cachedSafeguardAction = (maybeAction: MaybeOnAction, descriptorKey: string, location: string): OnAction | undefined => {\n if (!maybeAction) {\n return undefined;\n }\n\n const action = maybeAction as OnAction;\n\n if (actionsCache.has(action)) {\n return actionsCache.get(action);\n }\n\n const guardedAction = safeguardAction(action, descriptorKey, location);\n\n actionsCache.set(action, guardedAction);\n\n return guardedAction;\n};\n\nconst mergeAttributes = (\n base: ExtensionAttributes,\n provided: ExtensionAttributes,\n onAction?: ExtensionAttributes['onAction'],\n): ExtensionAttributes => {\n if (!onAction) {\n return {\n ...base,\n ...provided,\n };\n }\n\n return {\n ...base,\n ...provided,\n onAction,\n };\n};\n\nconst getExtensionApi = (\n key: string,\n extensionPoint: string,\n attributeMap: Map<string, ExtensionAttributes>,\n queueUpdate: ReturnType<typeof createAnimationFrameQueue>,\n cleanupCallbackQueue: ReturnType<typeof createCleanupCallbackQueue>['queue'],\n) => {\n const extensionAPI: ExtensionAPI = {\n updateAttributes(fnOrAttributes) {\n const currentAttributes = (attributeMap.has(key) && attributeMap.get(key)) || {};\n\n try {\n const updatedAttributes = typeof fnOrAttributes === 'function' ? fnOrAttributes(currentAttributes) : fnOrAttributes;\n const attributes = { ...currentAttributes, ...updatedAttributes };\n attributeMap.set(key, attributes);\n queueUpdate(key);\n } catch (e) {\n onDebug(({ error }) => ({\n level: error,\n message: `Updating attributes for extension ${key} failed:\n${e}`,\n meta: {\n extension: key,\n location: extensionPoint,\n },\n }));\n }\n },\n onCleanup(cleanupCallback) {\n cleanupCallbackQueue.push([key, cleanupCallback]);\n },\n };\n return extensionAPI;\n};\n\nconst getExtensionAttributes = (\n key: string,\n extensionPoint: string,\n attributesProvider: ExtensionAttributesProvider | undefined,\n baseAttributes: ExtensionDescriptor['attributes'],\n extensionAPI: ExtensionAPI,\n context: Context<{}> | null,\n): ExtensionAttributes | undefined => {\n if (!attributesProvider) {\n return baseAttributes;\n }\n\n // Try to get the attributes from the provider\n let providedAttributes: ExtensionAttributes = {};\n\n try {\n const rawProvidedAttributes = attributesProvider(extensionAPI, context);\n\n if (!rawProvidedAttributes || Object.getPrototypeOf(rawProvidedAttributes) !== Object.prototype) {\n throw new TypeError('The attributes provider functions should return attributes object');\n }\n\n providedAttributes = rawProvidedAttributes;\n } catch (e) {\n onDebug(({ error }) => ({\n level: error,\n message: `Calling the attributes provider for extension ${key} failed:\n ${e}`,\n meta: {\n extension: key,\n location: extensionPoint,\n },\n }));\n\n return undefined;\n }\n\n // Cache the onAction if present\n const onAction = providedAttributes.onAction && cachedSafeguardAction(providedAttributes.onAction, key, extensionPoint);\n\n return mergeAttributes(baseAttributes, providedAttributes, onAction);\n};\n\nconst sortDescriptorsByWeight = <T extends ExtensionAttributes>(extensionDescriptors: ExtensionDescriptor<T>[]) => {\n return extensionDescriptors.sort((a: ExtensionDescriptor<T>, b: ExtensionDescriptor<T>) => {\n const aWeight = a?.attributes?.weight ?? Infinity;\n const bWeight = b?.attributes?.weight ?? Infinity;\n\n return aWeight - bWeight;\n });\n};\n\ntype DescriptorUpdateBatch<T extends ExtensionAttributes> = {\n descriptors: ExtensionDescriptor<T>[];\n updatedDescriptors: ExtensionDescriptor<T>[];\n};\nconst inlineUpdateAttributes = <T extends ExtensionAttributes>(\n keys: Set<string>,\n attributeMap: Map<string, ExtensionAttributes>,\n descriptors: ExtensionDescriptor<T>[],\n): DescriptorUpdateBatch<T> => {\n const updated: ExtensionDescriptor<T>[] = [];\n descriptors\n .filter((descriptor) => keys.has(descriptor.key))\n .forEach((descriptor) => {\n descriptor.attributes = {\n ...descriptor.attributes,\n ...attributeMap.get(descriptor.key),\n };\n updated.push(descriptor);\n });\n\n return {\n descriptors: sortDescriptorsByWeight<T>(descriptors),\n updatedDescriptors: updated,\n };\n};\n\nconst createAnimationFrameQueue = (callback: (params: Set<string>) => void) => {\n let queue = new Set<string>();\n let requestIsQueued = false;\n const flushUpdate = () => {\n requestIsQueued = false;\n callback(queue);\n queue = new Set();\n };\n\n return (key: string) => {\n queue.add(key);\n\n if (!requestIsQueued) {\n requestIsQueued = true;\n requestAnimationFrame(flushUpdate);\n }\n };\n};\n\nconst createCleanupCallbackQueue = () => {\n const queue: [string, ExtensionCleanupCallback][] = [];\n const cleanUp = () => {\n while (queue.length) {\n const result = queue.shift();\n\n if (!result) {\n break;\n }\n\n const [descriptorKey, callback] = result;\n\n try {\n callback();\n } catch (e) {\n onDebug(({ error }) => ({\n level: error,\n message: `Failed to execute cleanup callback registered for \"${descriptorKey}\".\nSee passed callback for reference: ${callback}`,\n meta: {\n extension: descriptorKey,\n callback,\n },\n }));\n }\n }\n };\n\n return {\n queue,\n cleanUp,\n };\n};\n\nconst EMPTY_PAYLOAD: ExtensionPointUpdate = { state: { descriptors: [], loadingState: true }, update: [] };\n\n// eslint-disable-next-line import/prefer-default-export\nexport const getExtensionPointSubscription = <ContextT extends Context<{}> | null, AttributesT extends ExtensionAttributes>(\n extensionPoint: string,\n context: ContextT,\n): Observable<ExtensionPointUpdate<AttributesT>> => {\n let singletonObserver: Observer<ExtensionPointUpdate<AttributesT>>;\n let currentState: ExtensionDescriptor<AttributesT>[] = [];\n let currentLoadingState: boolean = true;\n\n const updateSubject = new ReplaySubject<ExtensionPointUpdate<AttributesT>>(1);\n const cleanupCallbackQueue = createCleanupCallbackQueue();\n const descriptorAttributeMap = new Map<string, ExtensionAttributes>();\n\n const animationFrameQueue = createAnimationFrameQueue((updatedKeys) => {\n const { descriptors, updatedDescriptors } = inlineUpdateAttributes(updatedKeys, descriptorAttributeMap, currentState);\n currentState = descriptors;\n updateSubject.notify({ state: { descriptors: currentState, loadingState: currentLoadingState }, update: updatedDescriptors });\n });\n\n const subscription = registry.getLocation(extensionPoint).subscribe(({ descriptors, loadingState }) => {\n // no need to validate while we are still loading.\n if (loadingState) {\n // @ts-expect-error Some issues with generics\n updateSubject.notify(EMPTY_PAYLOAD);\n return;\n }\n\n /*\n * TODO\n * - do we need to remove descriptors from the `descriptorMap` if they are no longer within the listed descriptors?\n * - do we need to override descriptors everytime they get \"re-registered\" or is that a `dev-mode` only feature?\n */\n const extensionDescriptors = descriptors\n .map((rawDescriptor): ExtensionDescriptor<AttributesT> | undefined => {\n const { attributesProvider, attributes: baseAttributes, key, ...descriptor } = rawDescriptor;\n\n const extensionAPI = getExtensionApi(\n key,\n extensionPoint,\n descriptorAttributeMap,\n animationFrameQueue,\n cleanupCallbackQueue.queue,\n );\n\n const maybeAttributes = getExtensionAttributes(\n key,\n extensionPoint,\n attributesProvider,\n baseAttributes,\n extensionAPI,\n context,\n );\n\n if (maybeAttributes === undefined) {\n return undefined;\n }\n\n const attributes: ExtensionAttributes = maybeAttributes;\n\n descriptorAttributeMap.set(key, attributes);\n\n const fullDescriptor: ExtensionDescriptor<AttributesT> = {\n ...descriptor,\n key,\n attributes: attributes as AttributesT,\n };\n\n return fullDescriptor;\n })\n .filter(isNotNullOrUndefined);\n\n currentState = sortDescriptorsByWeight<AttributesT>(extensionDescriptors);\n currentLoadingState = loadingState;\n\n updateSubject.notify({ state: { descriptors: currentState, loadingState }, update: currentState });\n });\n\n return {\n subscribe: (observer: Observer<ExtensionPointUpdate<AttributesT>>) => {\n if (singletonObserver !== undefined) {\n throw new Error('Only one observer is allowed to be registered on this Observable.');\n }\n\n singletonObserver = observer;\n updateSubject.subscribe(observer);\n return {\n unsubscribe: () => {\n updateSubject.unsubscribe(singletonObserver);\n subscription.unsubscribe();\n cleanupCallbackQueue.cleanUp();\n },\n };\n },\n };\n};\n\nconst componentDebugName = 'Schema Validation';\n\nconst gerErrorMessages = (errors: ValidationError[]): string[] => errors.map(({ error }) => error);\nconst getWarningMessages = (errors: ValidationWarning[]): string[] => errors.map(({ warning }) => warning);\n\n/**\n * Validates the attributes against the schema. Returns true if the attributes are valid.\n */\nconst runValidation = (validator: Validator, payload: unknown, extensionPoint: string, extensionKey: string): boolean => {\n if (!validator) {\n throw new Error(`No validator specified to validate extension point \"${extensionPoint}\"`);\n }\n\n const { errors, warnings } = validator(payload);\n\n if (errors.length !== 0) {\n const errorMessages = gerErrorMessages(errors);\n\n onDebug(({ error }) => ({\n level: error,\n message: `Schema validation for extension \"${extensionKey}\" returned errors.`,\n components: componentDebugName,\n meta: {\n location: extensionPoint,\n extension: extensionKey,\n errors: errorMessages,\n },\n }));\n }\n\n if (warnings.length !== 0) {\n const warningMessages = getWarningMessages(warnings);\n\n onDebug(({ warn }) => ({\n level: warn,\n message: `Schema validator for extension \"${extensionKey}\" returned warnings.`,\n components: componentDebugName,\n meta: {\n location: extensionPoint,\n extension: extensionKey,\n warnings: warningMessages,\n },\n }));\n }\n\n return errors.length === 0;\n};\n\n/**\n * Validates the context against the context schema. Returns true if the context is valid.\n */\nconst runContextValidation = (extensionPoint: string, validator: Validator | undefined, context: Context<{}> | null): boolean => {\n // This is a feedback for product developers and should not run in production\n if (process.env.NODE_ENV === 'production') {\n return true;\n }\n\n let errors: ValidationError[] = [];\n let warnings: ValidationWarning[] = [];\n\n if (context) {\n if (!validator) {\n throw new Error(`No context validator specified for extension point \"${extensionPoint}\"`);\n }\n\n ({ errors, warnings } = validator(context));\n\n if (errors.length) {\n const errorMessages = gerErrorMessages(errors);\n\n onDebug(({ error }) => ({\n level: error,\n message: `The context validation for extension-location \"${extensionPoint}\" returned errors.`,\n components: componentDebugName,\n meta: {\n extensionPoint,\n context,\n errors: errorMessages,\n },\n }));\n }\n if (warnings.length) {\n const warningMessages = getWarningMessages(warnings);\n\n onDebug(({ warn }) => ({\n level: warn,\n message: `The context validation for extension-location \"${extensionPoint}\" returned warnings.`,\n components: componentDebugName,\n meta: {\n extensionPoint,\n context,\n warnings: warningMessages,\n },\n }));\n }\n }\n\n return errors.length === 0;\n};\n\ntype DescriptorMap<T extends ExtensionAttributes = ExtensionAttributes> = Map<string, ExtensionDescriptor<T>>;\n\nconst transferDescriptorBetweenMaps = <T extends ExtensionAttributes>(\n descriptor: ExtensionDescriptor<T>,\n addToMap: DescriptorMap<T>,\n removeFromMap: DescriptorMap<T>,\n) => {\n if (removeFromMap.has(descriptor.key)) {\n removeFromMap.delete(descriptor.key);\n }\n addToMap.set(descriptor.key, descriptor);\n};\n\nexport const getValidatedExtensions = <ContextT extends Context<{}> | null, AttributesU extends ExtensionAttributes>(\n extensionPointName: string,\n context: ContextT,\n options: Options,\n): Observable<ExtensionState<AttributesU>> => {\n const { contextValidator, attributeValidator } = options;\n\n const isContextValid = runContextValidation(extensionPointName, contextValidator, context);\n\n if (!isContextValid) {\n throw new Error(`The context provided for extension-location \"${extensionPointName}\" does not match the schema`);\n }\n\n const validatedExtensionsSubject = new ReplaySubject<ExtensionState<AttributesU>>(1);\n let singletonObserver: Observer<ExtensionState<AttributesU>>;\n const supportedDescriptors: DescriptorMap<AttributesU> = new Map<string, ExtensionDescriptor<AttributesU>>();\n const unsupportedDescriptors: DescriptorMap<AttributesU> = new Map<string, ExtensionDescriptor<AttributesU>>();\n\n const subscription = getExtensionPointSubscription<ContextT, AttributesU>(extensionPointName, context).subscribe(\n ({ state, update }) => {\n const { loadingState } = state;\n\n // only reevaluate the updated descriptors\n update.forEach((descriptor) => {\n if (!runValidation(attributeValidator, descriptor.attributes, extensionPointName, descriptor.key)) {\n transferDescriptorBetweenMaps<AttributesU>(descriptor, unsupportedDescriptors, supportedDescriptors);\n } else {\n transferDescriptorBetweenMaps<AttributesU>(descriptor, supportedDescriptors, unsupportedDescriptors);\n }\n });\n\n validatedExtensionsSubject.notify([\n Array.from(supportedDescriptors.values()),\n Array.from(unsupportedDescriptors.values()),\n loadingState,\n ]);\n },\n );\n\n return {\n subscribe: (observer: Observer<ExtensionState<AttributesU>>) => {\n if (singletonObserver !== undefined) {\n throw new Error('Only one observer is allowed to be registered on this Observable.');\n }\n\n singletonObserver = observer;\n validatedExtensionsSubject.subscribe(observer);\n return {\n unsubscribe: () => {\n validatedExtensionsSubject.unsubscribe(singletonObserver);\n subscription.unsubscribe();\n },\n };\n },\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"ExtensionsObservable.js","sourceRoot":"","s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C,CAAC;oBAC1D,YAAY,CAAC,WAAW,EAAE,CAAC;gBAC/B,CAAC;aACJ,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import type {\n Context,\n ExtensionAPI,\n ExtensionAttributes,\n ExtensionAttributesProvider,\n ExtensionCleanupCallback,\n ExtensionDescriptor,\n MaybeOnAction,\n OnAction,\n} from '@atlassian/clientside-extensions-registry';\nimport registry from '@atlassian/clientside-extensions-registry';\nimport { onDebug } from '@atlassian/clientside-extensions-debug';\nimport type { Observable, Observer } from '@atlassian/clientside-extensions-base';\nimport { ReplaySubject } from '@atlassian/clientside-extensions-base';\n// We only import types here\n// eslint-disable-next-line node/no-unpublished-import\nimport type { Validator, ValidationError, ValidationWarning } from '@atlassian/clientside-extensions-schema';\nimport type { ExtensionPointUpdate, ExtensionState, Options } from './types';\nimport { isNotNullOrUndefined } from './types';\n\nconst safeguardAction = (action: OnAction, descriptorKey: string, location: string): OnAction => {\n return (...args: unknown[]) => {\n try {\n return action(...args);\n } catch (e) {\n onDebug(({ error }) => ({\n level: error,\n message: `Failed to execute onAction callback for extension \"${descriptorKey}\" at extension: ${location}.\n Error: ${e}`,\n meta: {\n extension: descriptorKey,\n location,\n },\n }));\n return undefined;\n }\n };\n};\n\nconst actionsCache = new Map<OnAction, OnAction>();\nconst cachedSafeguardAction = (maybeAction: MaybeOnAction, descriptorKey: string, location: string): OnAction | undefined => {\n if (!maybeAction) {\n return undefined;\n }\n\n const action = maybeAction as OnAction;\n\n if (actionsCache.has(action)) {\n return actionsCache.get(action);\n }\n\n const guardedAction = safeguardAction(action, descriptorKey, location);\n\n actionsCache.set(action, guardedAction);\n\n return guardedAction;\n};\n\nconst mergeAttributes = (\n base: ExtensionAttributes,\n provided: ExtensionAttributes,\n onAction?: ExtensionAttributes['onAction'],\n): ExtensionAttributes => {\n if (!onAction) {\n return {\n ...base,\n ...provided,\n };\n }\n\n return {\n ...base,\n ...provided,\n onAction,\n };\n};\n\nconst getExtensionApi = (\n key: string,\n extensionPoint: string,\n attributeMap: Map<string, ExtensionAttributes>,\n queueUpdate: ReturnType<typeof createAnimationFrameQueue>,\n cleanupCallbackQueue: ReturnType<typeof createCleanupCallbackQueue>['queue'],\n) => {\n const extensionAPI: ExtensionAPI = {\n updateAttributes(fnOrAttributes) {\n const currentAttributes = (attributeMap.has(key) && attributeMap.get(key)) || {};\n\n try {\n const updatedAttributes = typeof fnOrAttributes === 'function' ? fnOrAttributes(currentAttributes) : fnOrAttributes;\n const attributes = { ...currentAttributes, ...updatedAttributes };\n attributeMap.set(key, attributes);\n queueUpdate(key);\n } catch (e) {\n onDebug(({ error }) => ({\n level: error,\n message: `Updating attributes for extension ${key} failed:\n${e}`,\n meta: {\n extension: key,\n location: extensionPoint,\n },\n }));\n }\n },\n onCleanup(cleanupCallback) {\n cleanupCallbackQueue.push([key, cleanupCallback]);\n },\n };\n return extensionAPI;\n};\n\nconst getExtensionAttributes = (\n key: string,\n extensionPoint: string,\n attributesProvider: ExtensionAttributesProvider | undefined,\n baseAttributes: ExtensionDescriptor['attributes'],\n extensionAPI: ExtensionAPI,\n context: Context<{}> | null,\n): ExtensionAttributes | undefined => {\n if (!attributesProvider) {\n return baseAttributes;\n }\n\n // Try to get the attributes from the provider\n let providedAttributes: ExtensionAttributes = {};\n\n try {\n const rawProvidedAttributes = attributesProvider(extensionAPI, context);\n\n if (!rawProvidedAttributes || Object.getPrototypeOf(rawProvidedAttributes) !== Object.prototype) {\n throw new TypeError('The attributes provider functions should return attributes object');\n }\n\n providedAttributes = rawProvidedAttributes;\n } catch (e) {\n onDebug(({ error }) => ({\n level: error,\n message: `Calling the attributes provider for extension ${key} failed:\n ${e}`,\n meta: {\n extension: key,\n location: extensionPoint,\n },\n }));\n\n return undefined;\n }\n\n // Cache the onAction if present\n const onAction = providedAttributes.onAction && cachedSafeguardAction(providedAttributes.onAction, key, extensionPoint);\n\n return mergeAttributes(baseAttributes, providedAttributes, onAction);\n};\n\nconst sortDescriptorsByWeight = <T extends ExtensionAttributes>(extensionDescriptors: ExtensionDescriptor<T>[]) => {\n return extensionDescriptors.sort((a: ExtensionDescriptor<T>, b: ExtensionDescriptor<T>) => {\n const aWeight = a?.attributes?.weight ?? Infinity;\n const bWeight = b?.attributes?.weight ?? Infinity;\n\n return aWeight - bWeight;\n });\n};\n\ntype DescriptorUpdateBatch<T extends ExtensionAttributes> = {\n descriptors: ExtensionDescriptor<T>[];\n updatedDescriptors: ExtensionDescriptor<T>[];\n};\nconst inlineUpdateAttributes = <T extends ExtensionAttributes>(\n keys: Set<string>,\n attributeMap: Map<string, ExtensionAttributes>,\n descriptors: ExtensionDescriptor<T>[],\n): DescriptorUpdateBatch<T> => {\n const updated: ExtensionDescriptor<T>[] = [];\n descriptors\n .filter((descriptor) => keys.has(descriptor.key))\n .forEach((descriptor) => {\n descriptor.attributes = {\n ...descriptor.attributes,\n ...attributeMap.get(descriptor.key),\n };\n updated.push(descriptor);\n });\n\n return {\n descriptors: sortDescriptorsByWeight<T>(descriptors),\n updatedDescriptors: updated,\n };\n};\n\nconst createAnimationFrameQueue = (callback: (params: Set<string>) => void) => {\n let queue = new Set<string>();\n let requestIsQueued = false;\n const flushUpdate = () => {\n requestIsQueued = false;\n callback(queue);\n queue = new Set();\n };\n\n return (key: string) => {\n queue.add(key);\n\n if (!requestIsQueued) {\n requestIsQueued = true;\n requestAnimationFrame(flushUpdate);\n }\n };\n};\n\nconst createCleanupCallbackQueue = () => {\n const queue: [string, ExtensionCleanupCallback][] = [];\n const cleanUp = () => {\n while (queue.length) {\n const result = queue.shift();\n\n if (!result) {\n break;\n }\n\n const [descriptorKey, callback] = result;\n\n try {\n callback();\n } catch (e) {\n onDebug(({ error }) => ({\n level: error,\n message: `Failed to execute cleanup callback registered for \"${descriptorKey}\".\nSee passed callback for reference: ${callback}`,\n meta: {\n extension: descriptorKey,\n callback,\n },\n }));\n }\n }\n };\n\n return {\n queue,\n cleanUp,\n };\n};\n\nconst EMPTY_PAYLOAD: ExtensionPointUpdate = { state: { descriptors: [], loadingState: true }, update: [] };\n\n// eslint-disable-next-line import/prefer-default-export\nexport const getExtensionPointSubscription = <ContextT extends Context<{}> | null, AttributesT extends ExtensionAttributes>(\n extensionPoint: string,\n context: ContextT,\n): Observable<ExtensionPointUpdate<AttributesT>> => {\n let singletonObserver: Observer<ExtensionPointUpdate<AttributesT>>;\n let currentState: ExtensionDescriptor<AttributesT>[] = [];\n let currentLoadingState: boolean = true;\n\n const updateSubject = new ReplaySubject<ExtensionPointUpdate<AttributesT>>(1);\n const cleanupCallbackQueue = createCleanupCallbackQueue();\n const descriptorAttributeMap = new Map<string, ExtensionAttributes>();\n\n const animationFrameQueue = createAnimationFrameQueue((updatedKeys) => {\n const { descriptors, updatedDescriptors } = inlineUpdateAttributes(updatedKeys, descriptorAttributeMap, currentState);\n currentState = descriptors;\n updateSubject.notify({ state: { descriptors: currentState, loadingState: currentLoadingState }, update: updatedDescriptors });\n });\n\n const subscription = registry.getLocation(extensionPoint).subscribe(({ descriptors, loadingState }) => {\n // no need to validate while we are still loading.\n if (loadingState) {\n // @ts-expect-error Some issues with generics\n updateSubject.notify(EMPTY_PAYLOAD);\n return;\n }\n\n /*\n * TODO\n * - do we need to remove descriptors from the `descriptorMap` if they are no longer within the listed descriptors?\n * - do we need to override descriptors everytime they get \"re-registered\" or is that a `dev-mode` only feature?\n */\n const extensionDescriptors = descriptors\n .map((rawDescriptor): ExtensionDescriptor<AttributesT> | undefined => {\n const { attributesProvider, attributes: baseAttributes, key, ...descriptor } = rawDescriptor;\n\n const extensionAPI = getExtensionApi(\n key,\n extensionPoint,\n descriptorAttributeMap,\n animationFrameQueue,\n cleanupCallbackQueue.queue,\n );\n\n const maybeAttributes = getExtensionAttributes(\n key,\n extensionPoint,\n attributesProvider,\n baseAttributes,\n extensionAPI,\n context,\n );\n\n if (maybeAttributes === undefined) {\n return undefined;\n }\n\n const attributes: ExtensionAttributes = maybeAttributes;\n\n descriptorAttributeMap.set(key, attributes);\n\n const fullDescriptor: ExtensionDescriptor<AttributesT> = {\n ...descriptor,\n key,\n attributes: attributes as AttributesT,\n };\n\n return fullDescriptor;\n })\n .filter(isNotNullOrUndefined);\n\n currentState = sortDescriptorsByWeight<AttributesT>(extensionDescriptors);\n currentLoadingState = loadingState;\n\n updateSubject.notify({ state: { descriptors: currentState, loadingState }, update: currentState });\n });\n\n return {\n subscribe: (observer: Observer<ExtensionPointUpdate<AttributesT>>) => {\n if (singletonObserver !== undefined) {\n throw new Error('Only one observer is allowed to be registered on this Observable.');\n }\n\n singletonObserver = observer;\n updateSubject.subscribe(observer);\n return {\n unsubscribe: () => {\n updateSubject.unsubscribe(singletonObserver);\n subscription.unsubscribe();\n cleanupCallbackQueue.cleanUp();\n },\n };\n },\n };\n};\n\nconst componentDebugName = 'Schema Validation';\n\nconst gerErrorMessages = (errors: ValidationError[]): string[] => errors.map(({ error }) => error);\nconst getWarningMessages = (errors: ValidationWarning[]): string[] => errors.map(({ warning }) => warning);\n\n/**\n * Validates the attributes against the schema. Returns true if the attributes are valid.\n */\nconst runValidation = (validator: Validator, payload: unknown, extensionPoint: string, extensionKey: string): boolean => {\n if (!validator) {\n throw new Error(`No validator specified to validate extension point \"${extensionPoint}\"`);\n }\n\n const { errors, warnings } = validator(payload);\n\n if (errors.length !== 0) {\n const errorMessages = gerErrorMessages(errors);\n\n onDebug(({ error }) => ({\n level: error,\n message: `Schema validation for extension \"${extensionKey}\" returned errors.`,\n components: componentDebugName,\n meta: {\n location: extensionPoint,\n extension: extensionKey,\n errors: errorMessages,\n },\n }));\n }\n\n if (warnings.length !== 0) {\n const warningMessages = getWarningMessages(warnings);\n\n onDebug(({ warn }) => ({\n level: warn,\n message: `Schema validator for extension \"${extensionKey}\" returned warnings.`,\n components: componentDebugName,\n meta: {\n location: extensionPoint,\n extension: extensionKey,\n warnings: warningMessages,\n },\n }));\n }\n\n return errors.length === 0;\n};\n\n/**\n * Validates the context against the context schema. Returns true if the context is valid.\n */\nconst runContextValidation = (extensionPoint: string, validator: Validator | undefined, context: Context<{}> | null): boolean => {\n // This is a feedback for product developers and should not run in production\n if (process.env.NODE_ENV === 'production') {\n return true;\n }\n\n let errors: ValidationError[] = [];\n let warnings: ValidationWarning[] = [];\n\n if (context) {\n if (!validator) {\n throw new Error(`No context validator specified for extension point \"${extensionPoint}\"`);\n }\n\n ({ errors, warnings } = validator(context));\n\n if (errors.length) {\n const errorMessages = gerErrorMessages(errors);\n\n onDebug(({ error }) => ({\n level: error,\n message: `The context validation for extension-location \"${extensionPoint}\" returned errors.`,\n components: componentDebugName,\n meta: {\n extensionPoint,\n context,\n errors: errorMessages,\n },\n }));\n }\n if (warnings.length) {\n const warningMessages = getWarningMessages(warnings);\n\n onDebug(({ warn }) => ({\n level: warn,\n message: `The context validation for extension-location \"${extensionPoint}\" returned warnings.`,\n components: componentDebugName,\n meta: {\n extensionPoint,\n context,\n warnings: warningMessages,\n },\n }));\n }\n }\n\n return errors.length === 0;\n};\n\ntype DescriptorMap<T extends ExtensionAttributes = ExtensionAttributes> = Map<string, ExtensionDescriptor<T>>;\n\nconst transferDescriptorBetweenMaps = <T extends ExtensionAttributes>(\n descriptor: ExtensionDescriptor<T>,\n addToMap: DescriptorMap<T>,\n removeFromMap: DescriptorMap<T>,\n) => {\n if (removeFromMap.has(descriptor.key)) {\n removeFromMap.delete(descriptor.key);\n }\n addToMap.set(descriptor.key, descriptor);\n};\n\nexport const getValidatedExtensions = <ContextT extends Context<{}> | null, AttributesU extends ExtensionAttributes>(\n extensionPointName: string,\n context: ContextT,\n options: Options,\n): Observable<ExtensionState<AttributesU>> => {\n const { contextValidator, attributeValidator } = options;\n\n const isContextValid = runContextValidation(extensionPointName, contextValidator, context);\n\n if (!isContextValid) {\n throw new Error(`The context provided for extension-location \"${extensionPointName}\" does not match the schema`);\n }\n\n const validatedExtensionsSubject = new ReplaySubject<ExtensionState<AttributesU>>(1);\n let singletonObserver: Observer<ExtensionState<AttributesU>>;\n const supportedDescriptors: DescriptorMap<AttributesU> = new Map<string, ExtensionDescriptor<AttributesU>>();\n const unsupportedDescriptors: DescriptorMap<AttributesU> = new Map<string, ExtensionDescriptor<AttributesU>>();\n\n const subscription = getExtensionPointSubscription<ContextT, AttributesU>(extensionPointName, context).subscribe(\n ({ state, update }) => {\n const { loadingState } = state;\n\n // only reevaluate the updated descriptors\n update.forEach((descriptor) => {\n if (!runValidation(attributeValidator, descriptor.attributes, extensionPointName, descriptor.key)) {\n transferDescriptorBetweenMaps<AttributesU>(descriptor, unsupportedDescriptors, supportedDescriptors);\n } else {\n transferDescriptorBetweenMaps<AttributesU>(descriptor, supportedDescriptors, unsupportedDescriptors);\n }\n });\n\n validatedExtensionsSubject.notify([\n Array.from(supportedDescriptors.values()),\n Array.from(unsupportedDescriptors.values()),\n loadingState,\n ]);\n },\n );\n\n return {\n subscribe: (observer: Observer<ExtensionState<AttributesU>>) => {\n if (singletonObserver !== undefined) {\n throw new Error('Only one observer is allowed to be registered on this Observable.');\n }\n\n singletonObserver = observer;\n validatedExtensionsSubject.subscribe(observer);\n return {\n unsubscribe: () => {\n validatedExtensionsSubject.unsubscribe(singletonObserver);\n subscription.unsubscribe();\n },\n };\n },\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncPanelHandler.js","sourceRoot":"","sources":["../../../lib/handlers/AsyncPanelHandler.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAc9C,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEtB,MAAM,UAAU,GAAG,KAAK,EACpB,cAA8G,EAC9G,YAAoB,EACpB,QAAgB,EACsC,EAAE;IACxD,IAAI;
|
|
1
|
+
{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,MAAM,gBAAgB,GAAG,MAAM,UAAU,CAAC,cAAc,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;YAElF,IAAI,SAAS,EAAE,CAAC;gBACZ,OAAO;YACX,CAAC;YAED,WAAW,CAAC,OAAO,GAAG,gBAAgB,CAAC;YACvC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QAED,kBAAkB,EAAE,CAAC;QAErB,OAAO,GAAG,EAAE;YACR,SAAS,GAAG,IAAI,CAAC;QACrB,CAAC,CAAC;IACN,CAAC,EACD,CAAC,cAAc,EAAE,YAAY,EAAE,QAAQ,CAAC,CAC3C,CAAC;IAEF,IAAI,CAAC,cAAc,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;QAC1C,OAAO,QAAQ,CAAC,CAAC,CAAC,0CAAG,QAAQ,CAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7C,CAAC;IAED,OAAO,oBAAC,YAAY,IAAC,MAAM,EAAE,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAI,CAAC;AAC/F,CAAC,CAAC","sourcesContent":["import type { FunctionComponent } from 'react';\nimport React, { useEffect, useRef, useState, useMemo } from 'react';\nimport type { AsyncPanelExtension } from '@atlassian/clientside-extensions';\nimport { onDebug } from '@atlassian/clientside-extensions-debug';\nimport type { Context } from '@atlassian/clientside-extensions-registry';\nimport type { PanelHandlerProps } from './PanelHandler';\nimport { PanelHandler } from './PanelHandler';\n\nexport type AsyncPanelRenderExtension = () => Promise<{ default: AsyncPanelExtension.AsyncPanelRenderExtension; __esModule: boolean }>;\n\nexport interface AsyncPanelHandlerProps {\n fallback?: JSX.Element | string;\n location: string;\n pluginKey: string;\n extensionKey?: string;\n renderProvider: AsyncPanelRenderExtension;\n contextProvider?: () => Context<{}>;\n RootType?: PanelHandlerProps['RootType'];\n}\n\nconst noop = () => {};\n\nconst loadModule = async (\n moduleProvider: () => Promise<{ default: AsyncPanelExtension.AsyncPanelRenderExtension; __esModule: boolean }>,\n extensionKey: string,\n location: string,\n): Promise<AsyncPanelExtension.AsyncPanelRenderExtension> => {\n try {\n const resolvedModule = await moduleProvider();\n // eslint-disable-next-line no-underscore-dangle\n if (!resolvedModule || !resolvedModule.__esModule || typeof resolvedModule.default !== 'function') {\n onDebug(({ error }) => ({\n level: error,\n\n message: `The provided dynamic import of extension \"${extensionKey}\" at location \"${location}\" does not look like a module that can be asynchronously loaded.`,\n components: ['AsyncPanelHandler'],\n meta: {\n location,\n extension: extensionKey,\n },\n }));\n\n return noop;\n }\n\n return resolvedModule.default;\n } catch (e) {\n onDebug(({ error }) => ({\n level: error,\n\n message: `Failed trying to execute the dynamic import from extension \"${extensionKey}\" for the async panel at location \"${location}\"`,\n components: ['AsyncPanelHandler'],\n meta: {\n location,\n extension: extensionKey,\n error: e,\n },\n }));\n\n return noop;\n }\n};\n\nexport const AsyncPanelHandler: FunctionComponent<AsyncPanelHandlerProps> = ({\n contextProvider,\n fallback,\n location,\n pluginKey,\n extensionKey = pluginKey,\n renderProvider,\n RootType,\n}) => {\n const rendererRef = useRef<AsyncPanelExtension.AsyncPanelRenderExtension>();\n const [isModuleLoaded, setIsModuleLoaded] = useState(false);\n\n const context = useMemo<Context<{}>>(() => {\n let contextValue: Context<{}> = {};\n\n if (typeof contextProvider === 'function') {\n try {\n contextValue = contextProvider();\n } catch (e) {\n onDebug(({ error }) => ({\n level: error,\n\n message: `Failed to invoke \"contextProvider\" function for extension \"${extensionKey}\" at location \"${location}\".\\nError: ${e}`,\n components: ['AsyncPanelHandler'],\n meta: {\n location,\n extension: extensionKey,\n },\n }));\n }\n }\n\n return contextValue;\n }, [contextProvider, location, extensionKey]);\n\n useEffect(\n function asyncLoadRendererModule() {\n let didCancel = false;\n\n async function loadRendererModule() {\n setIsModuleLoaded(false);\n rendererRef.current = undefined;\n\n const resolvedRenderer = await loadModule(renderProvider, extensionKey, location);\n\n if (didCancel) {\n return;\n }\n\n rendererRef.current = resolvedRenderer;\n setIsModuleLoaded(true);\n }\n\n loadRendererModule();\n\n return () => {\n didCancel = true;\n };\n },\n [renderProvider, extensionKey, location],\n );\n\n if (!isModuleLoaded || !rendererRef.current) {\n return fallback ? <>{fallback}</> : null;\n }\n\n return <PanelHandler render={rendererRef.current} RootType={RootType} context={context} />;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonHandler.js","sourceRoot":"","sources":["../../../lib/handlers/ButtonHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"ButtonHandler.js","sourceRoot":"","sources":["../../../lib/handlers/ButtonHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAQtD,MAAM,CAAC,MAAM,aAAa,GAA0C,CAAC,EACjE,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,SAAS,EACT,UAAU,EACV,QAAQ,EACR,OAAO,GACV,EAAE,EAAE;IACD,IAAI,MAAM,EAAE,CAAC;QACT,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CACH,oBAAC,MAAM,IACH,IAAI,EAAC,QAAQ,EACb,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,QAAQ,EACpB,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,OAAO,IAEf,QAAQ,CACJ,CACZ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport Button from '@atlaskit/button/standard-button';\nimport type { FunctionComponent } from 'react';\nimport type { OnClickHandler } from './types';\n\nexport interface ButtonHandlerProps extends OnClickHandler {\n children?: React.ReactNode;\n}\n\nexport const ButtonHandler: FunctionComponent<ButtonHandlerProps> = ({\n appearance,\n children,\n disabled,\n hidden,\n iconAfter,\n iconBefore,\n onAction,\n spacing,\n}) => {\n if (hidden) {\n return null;\n }\n\n return (\n <Button\n type=\"button\"\n appearance={appearance}\n iconAfter={iconAfter}\n iconBefore={iconBefore}\n isDisabled={disabled}\n onClick={onAction}\n spacing={spacing}\n >\n {children}\n </Button>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkHandler.js","sourceRoot":"","sources":["../../../lib/handlers/LinkHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"LinkHandler.js","sourceRoot":"","sources":["../../../lib/handlers/LinkHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAStD,MAAM,CAAC,MAAM,WAAW,GAAwC,CAAC,EAC7D,UAAU,GAAG,MAAM,EACnB,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,SAAS,EACT,UAAU,EACV,QAAQ,EACR,OAAO,GACV,EAAE,EAAE;IACD,IAAI,MAAM,EAAE,CAAC;QACT,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CACH,oBAAC,MAAM,IACH,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,QAAQ,EACpB,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,OAAO,IAEf,QAAQ,CACJ,CACZ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport Button from '@atlaskit/button/standard-button';\nimport type { FunctionComponent } from 'react';\nimport type { OnClickHandler } from './types';\n\nexport interface LinkHandlerProps extends Partial<OnClickHandler> {\n href: string;\n children?: React.ReactNode;\n}\n\nexport const LinkHandler: FunctionComponent<LinkHandlerProps> = ({\n appearance = 'link',\n children,\n disabled,\n hidden,\n href,\n iconAfter,\n iconBefore,\n onAction,\n spacing,\n}) => {\n if (hidden) {\n return null;\n }\n\n return (\n <Button\n appearance={appearance}\n href={href}\n iconAfter={iconAfter}\n iconBefore={iconBefore}\n isDisabled={disabled}\n onClick={onAction}\n spacing={spacing}\n >\n {children}\n </Button>\n );\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import ModalDialog, {
|
|
3
|
-
import LoadingButton from '@atlaskit/button/loading-button';
|
|
1
|
+
import Button from '@atlaskit/button/new';
|
|
2
|
+
import ModalDialog, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
4
3
|
import { ModalExtension } from '@atlassian/clientside-extensions';
|
|
4
|
+
import React, { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import { ButtonHandler } from './ButtonHandler';
|
|
6
6
|
const ModalInnerBody = ({ modalApi }) => {
|
|
7
7
|
const ref = useRef(null);
|
|
@@ -39,9 +39,9 @@ export const ModalHandler = ({ render, isOpen, onClose, __withoutTransition = fa
|
|
|
39
39
|
}, [modalApi, onClose]);
|
|
40
40
|
const actionsAsButtons = useMemo(() => actions.map(({ testId, isLoading, text, onClick, isDisabled }, index) => (
|
|
41
41
|
// eslint-disable-next-line react/no-array-index-key
|
|
42
|
-
React.createElement(
|
|
42
|
+
React.createElement(Button, { key: index, isLoading: isLoading, testId: testId, isDisabled: isDisabled, onClick: onClick }, text))), [actions]);
|
|
43
43
|
return (React.createElement(Wrapper, null, isOpen && (React.createElement(ModalDialog, { testId: "client-extensions-modal", width: modalApi.getWidth(), onClose: onCloseHandler, stackIndex: stackIndex },
|
|
44
|
-
React.createElement(ModalHeader,
|
|
44
|
+
React.createElement(ModalHeader, { hasCloseButton: true },
|
|
45
45
|
React.createElement(ModalTitle, { appearance: modalApi.getAppearance() }, modalApi.getTitle())),
|
|
46
46
|
React.createElement(ModalBody, null,
|
|
47
47
|
React.createElement(ModalInnerBody, { modalApi: modalApi })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalHandler.js","sourceRoot":"","sources":["../../../lib/handlers/ModalHandler.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ModalHandler.js","sourceRoot":"","sources":["../../../lib/handlers/ModalHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAE1C,OAAO,WAAW,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACvH,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,MAAM,cAAc,GAAwD,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACzF,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAEzC,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC;QAEzB,IAAI,IAAI,EAAE,CAAC;YACP,QAAQ,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC;QAED,OAAO,GAAG,EAAE;YACR,IAAI,IAAI,EAAE,CAAC;gBACP,QAAQ,CAAC,kBAAkB,EAAE,CAAC,IAAI,CAAC,CAAC;YACxC,CAAC;QACL,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,6BAAK,GAAG,EAAE,GAAG,GAAI,CAAC;AAC7B,CAAC,CAAC;AAUF,M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ChB,CAAC;IAED,OAAO,CACH;QACI,oBAAC,aAAa,IACV,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,OAAO,IAEf,QAAQ,CACG;QAChB,oBAAC,YAAY,IACT,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,kBAAkB,EACtC,mBAAmB,EAAE,mBAAmB,GAC1C,CACH,CACN,CAAC;AACN,CAAC,CAAC","sourcesContent":["import Button from '@atlaskit/button/new';\nimport type { KeyboardOrMouseEvent } from '@atlaskit/modal-dialog';\nimport ModalDialog, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';\nimport { ModalExtension } from '@atlassian/clientside-extensions';\nimport type { FunctionComponent, ReactNode } from 'react';\nimport React, { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { ButtonHandler } from './ButtonHandler';\nimport type { OnClickHandler } from './types';\n\nconst ModalInnerBody: FunctionComponent<{ modalApi: ModalExtension.Api }> = ({ modalApi }) => {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const node = ref.current;\n\n if (node) {\n modalApi.getRenderCallback()(node);\n }\n\n return () => {\n if (node) {\n modalApi.getCleanupCallback()(node);\n }\n };\n }, [modalApi]);\n\n return <div ref={ref} />;\n};\n\nexport interface ModalHandlerProps {\n render: ModalExtension.ModalRenderExtension;\n isOpen: boolean;\n onClose: () => void;\n __withoutTransition?: boolean;\n __disableFocusLock?: boolean;\n}\n\nexport const ModalHandler: FunctionComponent<ModalHandlerProps> = ({\n render,\n isOpen,\n onClose,\n __withoutTransition = false,\n __disableFocusLock = false,\n}) => {\n const [actions, setActions] = useState<ModalExtension.ModalAction[]>([]);\n const modalApi = useMemo(() => {\n const api = new ModalExtension.Api(onClose, setActions);\n render(api);\n return api;\n }, [render, onClose]);\n\n const Wrapper = __withoutTransition ? Fragment : ModalTransition;\n\n // Here will be dragons. That's a fishy solution for programmatically disabling the focus lock of the Atlaskit Modal component.\n // When the stackIndex > 0 this will disable the focus lock of the Modal. That's quite naive implementation since we are abusing\n // the Atlaskit stacking mechanism.\n const stackIndex = __disableFocusLock ? 1 : 0;\n\n const onCloseHandler = useCallback(\n (e: KeyboardOrMouseEvent) => {\n const closeResult = modalApi.getOnCloseCallback()(e);\n // prevent closing of modal if \"closeRequest\" is \"false\"\n if (closeResult !== false) {\n onClose();\n }\n },\n [modalApi, onClose],\n );\n\n const actionsAsButtons: JSX.Element[] = useMemo<JSX.Element[]>(\n () =>\n actions.map(({ testId, isLoading, text, onClick, isDisabled }, index) => (\n // eslint-disable-next-line react/no-array-index-key\n <Button key={index} isLoading={isLoading} testId={testId} isDisabled={isDisabled} onClick={onClick}>\n {text}\n </Button>\n )),\n [actions],\n );\n\n return (\n <Wrapper>\n {isOpen && (\n <ModalDialog testId=\"client-extensions-modal\" width={modalApi.getWidth()} onClose={onCloseHandler} stackIndex={stackIndex}>\n <ModalHeader hasCloseButton>\n <ModalTitle appearance={modalApi.getAppearance()}>{modalApi.getTitle()}</ModalTitle>\n </ModalHeader>\n <ModalBody>\n <ModalInnerBody modalApi={modalApi} />\n </ModalBody>\n <ModalFooter>{actionsAsButtons}</ModalFooter>\n </ModalDialog>\n )}\n </Wrapper>\n );\n};\n\nexport interface ModalWithActionHandlerProps extends Omit<OnClickHandler, 'onAction'> {\n children?: ReactNode;\n render: ModalExtension.ModalRenderExtension;\n __withoutTransition?: boolean;\n __disableFocusLock?: boolean;\n}\n\nexport const ModalWithActionHandler: FunctionComponent<ModalWithActionHandlerProps> = ({\n // Action Handler Properties\n appearance,\n children,\n disabled,\n hidden,\n iconAfter,\n iconBefore,\n spacing,\n\n // Modal Handler Properties\n render,\n __withoutTransition,\n __disableFocusLock,\n}) => {\n const [isOpen, setIsOpen] = useState(false);\n\n const openModal = useCallback(() => {\n setIsOpen(true);\n }, []);\n\n const closeModal = useCallback(() => {\n setIsOpen(false);\n }, []);\n\n if (hidden) {\n return null;\n }\n\n return (\n <>\n <ButtonHandler\n appearance={appearance}\n iconAfter={iconAfter}\n iconBefore={iconBefore}\n disabled={disabled}\n hidden={hidden}\n onAction={openModal}\n spacing={spacing}\n >\n {children}\n </ButtonHandler>\n <ModalHandler\n isOpen={isOpen}\n onClose={closeModal}\n render={render}\n __disableFocusLock={__disableFocusLock}\n __withoutTransition={__withoutTransition}\n />\n </>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelHandler.js","sourceRoot":"","sources":["../../../lib/handlers/PanelHandler.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAelE,MAAM,KAAK,GAAG,CAAC,OAAe,EAAoB,EAAE,CAAC,OAAO,KAAK,KAAK,CAAC;AAEvE,MAAM,CAAC,MAAM,YAAY,GAAyC,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAG,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;IACxG,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,cAAc,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7D,MAAM,GAAG,GAAG,MAAM,CAAmC,IAAI,CAAC,CAAC;IAE3D,SAAS,CACL,SAAS,qCAAqC;QAC1C,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC;QAEzB,IAAI,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"PanelHandler.js","sourceRoot":"","sources":["../../../lib/handlers/PanelHandler.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAelE,MAAM,KAAK,GAAG,CAAC,OAAe,EAAoB,EAAE,CAAC,OAAO,KAAK,KAAK,CAAC;AAEvE,MAAM,CAAC,MAAM,YAAY,GAAyC,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAG,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;IACxG,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,cAAc,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7D,MAAM,GAAG,GAAG,MAAM,CAAmC,IAAI,CAAC,CAAC;IAE3D,SAAS,CACL,SAAS,qCAAqC;QAC1C,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC;QAEzB,IAAI,MAAM,EAAE,CAAC;YACT,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC9B,CAAC;QAED,IAAI,IAAI,EAAE,CAAC;YACP,QAAQ,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC;QAED,OAAO,GAAG,EAAE;YACR,IAAI,IAAI,EAAE,CAAC;gBACP,QAAQ,CAAC,kBAAkB,EAAE,CAAC,IAAI,CAAC,CAAC;YACxC,CAAC;QACL,CAAC,CAAC;IACN,CAAC,EACD,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAC9B,CAAC;IAEF,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAClB,OAAO,oBAAC,QAAQ,IAAC,GAAG,EAAE,GAAuC,GAAI,CAAC;IACtE,CAAC;IAED,OAAO,oBAAC,QAAQ,IAAC,GAAG,EAAE,GAAwC,GAAI,CAAC;AACvE,CAAC,CAAC","sourcesContent":["import type { FunctionComponent, MutableRefObject } from 'react';\nimport React, { useEffect, useMemo, useRef } from 'react';\nimport type { Context } from '@atlassian/clientside-extensions-registry';\nimport { PanelExtension } from '@atlassian/clientside-extensions';\n\nexport interface PanelHandlerProps {\n render: PanelExtension.PanelRenderExtension;\n RootType?: 'div' | 'span';\n /*\n Hello dear reader of inline comments. You might rightfully ask: what the hell is \"context\" doing here.\n Well turns out you are not the first.\n The reason is, that async-panel is reusing the panel handler under the hood. And the only way to let the panel have\n access to the context is by passing it through via a \"contextProvider\" (check the AsyncPanelExtension).\n So yeah, that is why we are here. And that is why \"context\" has to stay.\n */\n context?: Context<{}>;\n}\n\nconst isDiv = (RooType: string): RooType is 'div' => RooType === 'div';\n\nexport const PanelHandler: FunctionComponent<PanelHandlerProps> = ({ render, RootType = 'div', context }) => {\n const panelApi = useMemo(() => new PanelExtension.Api(), []);\n const ref = useRef<HTMLDivElement | HTMLSpanElement>(null);\n\n useEffect(\n function callMountAndUnmountLifecycleCallbacks() {\n const node = ref.current;\n\n if (render) {\n render(panelApi, context);\n }\n\n if (node) {\n panelApi.getRenderCallback()(node);\n }\n\n return () => {\n if (node) {\n panelApi.getCleanupCallback()(node);\n }\n };\n },\n [panelApi, render, context],\n );\n\n if (isDiv(RootType)) {\n return <RootType ref={ref as MutableRefObject<HTMLDivElement>} />;\n }\n\n return <RootType ref={ref as MutableRefObject<HTMLSpanElement>} />;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionHandler.js","sourceRoot":"","sources":["../../../lib/handlers/SectionHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SectionHandler.js","sourceRoot":"","sources":["../../../lib/handlers/SectionHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,CAAC,MAAM,cAAc,GAA2C,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACnF,OAAO,0CAAG,QAAQ,CAAI,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport type { FunctionComponent } from 'react';\n\n// eslint-disable-next-line import/prefer-default-export\ninterface SectionHandlerProps {\n children: React.ReactNode;\n}\n\nexport const SectionHandler: FunctionComponent<SectionHandlerProps> = ({ children }) => {\n return <>{children}</>;\n};\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import ReactDOM from 'react-dom';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { StrictMode } from 'react';
|
|
3
3
|
function renderElementAsReact(renderApi, RenderElement, additionalProps) {
|
|
4
4
|
renderApi
|
|
5
5
|
.onMount((element) => {
|
|
6
6
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
7
|
-
ReactDOM.render(React.createElement(
|
|
7
|
+
ReactDOM.render(React.createElement(StrictMode, null,
|
|
8
|
+
React.createElement(RenderElement, { ...additionalProps })), element);
|
|
8
9
|
})
|
|
9
10
|
.onUnmount((element) => {
|
|
10
11
|
ReactDOM.unmountComponentAtNode(element);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderElementAsReact.js","sourceRoot":"","sources":["../../lib/renderElementAsReact.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"renderElementAsReact.js","sourceRoot":"","sources":["../../lib/renderElementAsReact.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG1C,SAAS,oBAAoB,CACzB,SAA6B,EAC7B,aAAoC,EACpC,eAAyB;IAEzB,SAAS;SACJ,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QACjB,wDAAwD;QACxD,QAAQ,CAAC,MAAM,CACX,oBAAC,UAAU;YACP,oBAAC,aAAa,OAAM,eAA0B,GAAI,CACzC,EACb,OAAO,CACV,CAAC;IACN,CAAC,CAAC;SACD,SAAS,CAAC,CAAC,OAAO,EAAE,EAAE;QACnB,QAAQ,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACX,CAAC;AAED,eAAe,oBAAoB,CAAC","sourcesContent":["import ReactDOM from 'react-dom';\nimport type { ComponentType } from 'react';\nimport React, { StrictMode } from 'react';\nimport type { MountableExtension } from '@atlassian/clientside-extensions';\n\nfunction renderElementAsReact<PropsT extends React.JSX.IntrinsicAttributes>(\n renderApi: MountableExtension,\n RenderElement: ComponentType<PropsT>,\n additionalProps?: unknown,\n) {\n renderApi\n .onMount((element) => {\n // eslint-disable-next-line react/jsx-props-no-spreading\n ReactDOM.render(\n <StrictMode>\n <RenderElement {...(additionalProps as PropsT)} />\n </StrictMode>,\n element,\n );\n })\n .onUnmount((element) => {\n ReactDOM.unmountComponentAtNode(element);\n });\n}\n\nexport default renderElementAsReact;\n"]}
|
package/dist/esm/styled.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { token } from '@atlaskit/tokens';
|
|
1
2
|
import styled from '@emotion/styled';
|
|
2
|
-
import { keyframes } from '@emotion/
|
|
3
|
-
|
|
4
|
-
import { themed } from '@atlaskit/theme/components';
|
|
5
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
3
|
+
import { keyframes } from '@emotion/react';
|
|
4
|
+
export const GRID_SIZE = 8;
|
|
6
5
|
export const BlinkerContainer = styled.span `
|
|
7
6
|
position: relative;
|
|
8
7
|
`;
|
|
@@ -15,10 +14,11 @@ const blinkAnimation = keyframes `
|
|
|
15
14
|
transform: scale(1.3);
|
|
16
15
|
}
|
|
17
16
|
`;
|
|
17
|
+
/* eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage */
|
|
18
18
|
export const Blinker = styled.button `
|
|
19
19
|
height: 22px;
|
|
20
20
|
width: 22px;
|
|
21
|
-
background:
|
|
21
|
+
background: ${token('color.background.input')};
|
|
22
22
|
border-radius: 50%;
|
|
23
23
|
animation: ${blinkAnimation} 1s ease-in-out infinite;
|
|
24
24
|
animation-direction: alternate;
|
|
@@ -41,66 +41,36 @@ export const Blinker = styled.button `
|
|
|
41
41
|
// AK doesn't provide a plain Table styled component.
|
|
42
42
|
// Using AK theme to be compatible with their dark mode.
|
|
43
43
|
// Styles copied from: https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/design-system/dynamic-table/src/styled/
|
|
44
|
-
const rowTheme = {
|
|
45
|
-
focusOutline: themed({ light: colors.B100, dark: colors.B100 }),
|
|
46
|
-
borderColor: themed({ light: colors.N40, dark: colors.DN50 }),
|
|
47
|
-
highlightedBackground: themed({ light: colors.N20, dark: colors.DN50 }),
|
|
48
|
-
hoverBackground: themed({ light: colors.N10, dark: colors.DN40 }),
|
|
49
|
-
hoverHighlightedBackground: themed({ light: colors.N30, dark: colors.DN60 }),
|
|
50
|
-
};
|
|
51
|
-
const headTheme = {
|
|
52
|
-
focusOutline: themed({ light: colors.B100, dark: colors.B100 }),
|
|
53
|
-
borderColor: themed({ light: colors.N40, dark: colors.DN50 }),
|
|
54
|
-
textColor: themed({ light: colors.N300, dark: colors.DN300 }),
|
|
55
|
-
};
|
|
56
44
|
export const Table = styled.table `
|
|
57
45
|
border-collapse: collapse;
|
|
58
46
|
width: 100%;
|
|
59
47
|
`;
|
|
60
48
|
export const HeadRow = styled.tr `
|
|
61
|
-
border-bottom:
|
|
49
|
+
border-bottom: 1px solid ${token('color.border')};
|
|
62
50
|
`;
|
|
63
51
|
export const HeadCell = styled.th `
|
|
64
|
-
padding: ${
|
|
65
|
-
&:first-of-type {
|
|
66
|
-
padding-left: 0;
|
|
67
|
-
}
|
|
68
|
-
&:last-of-type {
|
|
69
|
-
padding-right: 0;
|
|
70
|
-
}
|
|
52
|
+
padding: ${GRID_SIZE / 2}px ${GRID_SIZE}px;
|
|
71
53
|
border: none;
|
|
72
|
-
color: ${
|
|
54
|
+
color: ${token('color.text')};
|
|
73
55
|
box-sizing: border-box;
|
|
74
56
|
font-size: 12px;
|
|
75
57
|
font-weight: bold;
|
|
76
58
|
position: relative;
|
|
77
59
|
text-align: left;
|
|
78
60
|
vertical-align: top;
|
|
79
|
-
&:focus {
|
|
80
|
-
outline: solid 2px ${headTheme.focusOutline};
|
|
81
|
-
}
|
|
82
61
|
`;
|
|
83
|
-
const outlineWidth = '2px';
|
|
84
62
|
export const TableRow = styled.tr `
|
|
85
|
-
border-bottom:
|
|
63
|
+
border-bottom: 1px solid ${token('color.border')};
|
|
86
64
|
&:hover {
|
|
87
|
-
background-color: ${
|
|
88
|
-
}
|
|
89
|
-
&:focus {
|
|
90
|
-
outline: ${outlineWidth} solid ${rowTheme.focusOutline};
|
|
91
|
-
outline-offset: -${outlineWidth};
|
|
65
|
+
background-color: ${token('color.background.neutral.subtle.hovered')};
|
|
92
66
|
}
|
|
93
67
|
`;
|
|
94
68
|
export const TableCell = styled.td `
|
|
95
69
|
border: none;
|
|
96
|
-
padding: ${
|
|
70
|
+
padding: ${GRID_SIZE / 1.2}px ${GRID_SIZE}px;
|
|
97
71
|
text-align: left;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
&:last-of-type {
|
|
103
|
-
padding-right: 0;
|
|
104
|
-
}
|
|
72
|
+
`;
|
|
73
|
+
export const HeadingWrapper = styled.div `
|
|
74
|
+
margin-top: 30px;
|
|
105
75
|
`;
|
|
106
76
|
//# sourceMappingURL=styled.js.map
|
package/dist/esm/styled.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sourceRoot":"","sources":["../../lib/styled.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"styled.js","sourceRoot":"","sources":["../../lib/styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC;AAE3B,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAA;;CAE1C,CAAC;AAEF,MAAM,cAAc,GAAG,SAAS,CAAA;;;;;;;;CAQ/B,CAAC;AAEF,gFAAgF;AAChF,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAA;;;kBAGlB,KAAK,CAAC,wBAAwB,CAAC;;iBAEhC,cAAc;;;;;;;;;;;;;;;;;CAiB9B,CAAC;AAEF,qDAAqD;AACrD,wDAAwD;AACxD,qIAAqI;AACrI,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;;;CAGhC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,EAAE,CAAA;+BACD,KAAK,CAAC,cAAc,CAAC;CACnD,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAA;eAClB,SAAS,GAAG,CAAC,MAAM,SAAS;;aAE9B,KAAK,CAAC,YAAY,CAAC;;;;;;;CAO/B,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAA;+BACF,KAAK,CAAC,cAAc,CAAC;;4BAExB,KAAK,CAAC,yCAAyC,CAAC;;CAE3E,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,EAAE,CAAA;;eAEnB,SAAS,GAAG,GAAG,MAAM,SAAS;;CAE5C,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEvC,CAAC","sourcesContent":["import { token } from '@atlaskit/tokens';\nimport styled from '@emotion/styled';\nimport { keyframes } from '@emotion/react';\n\nexport const GRID_SIZE = 8;\n\nexport const BlinkerContainer = styled.span`\n position: relative;\n`;\n\nconst blinkAnimation = keyframes`\n from {\n transform: scale(1);\n }\n\n to {\n transform: scale(1.3);\n }\n`;\n\n/* eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage */\nexport const Blinker = styled.button`\n height: 22px;\n width: 22px;\n background: ${token('color.background.input')};\n border-radius: 50%;\n animation: ${blinkAnimation} 1s ease-in-out infinite;\n animation-direction: alternate;\n cursor: pointer;\n border: none;\n\n &:after {\n display: block;\n background: rgb(7, 71, 166, 0.8);\n position: absolute;\n height: 12px;\n width: 12px;\n content: '';\n left: 50%;\n top: 50%;\n margin: -6px 0 0 -6px;\n border-radius: 50%;\n }\n`;\n\n// AK doesn't provide a plain Table styled component.\n// Using AK theme to be compatible with their dark mode.\n// Styles copied from: https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/design-system/dynamic-table/src/styled/\nexport const Table = styled.table`\n border-collapse: collapse;\n width: 100%;\n`;\n\nexport const HeadRow = styled.tr`\n border-bottom: 1px solid ${token('color.border')};\n`;\n\nexport const HeadCell = styled.th`\n padding: ${GRID_SIZE / 2}px ${GRID_SIZE}px;\n border: none;\n color: ${token('color.text')};\n box-sizing: border-box;\n font-size: 12px;\n font-weight: bold;\n position: relative;\n text-align: left;\n vertical-align: top;\n`;\n\nexport const TableRow = styled.tr`\n border-bottom: 1px solid ${token('color.border')};\n &:hover {\n background-color: ${token('color.background.neutral.subtle.hovered')};\n }\n`;\n\nexport const TableCell = styled.td`\n border: none;\n padding: ${GRID_SIZE / 1.2}px ${GRID_SIZE}px;\n text-align: left;\n`;\n\nexport const HeadingWrapper = styled.div`\n margin-top: 30px;\n`;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExtensions.js","sourceRoot":"","sources":["../../lib/useExtensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAA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;AAChC,CAAC,CAAC","sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport isEqual from 'lodash.isequal';\nimport type { ExtensionAttributes, Context } from '@atlassian/clientside-extensions-registry';\nimport { onDebug } from '@atlassian/clientside-extensions-debug';\nimport { getValidatedExtensions } from './ExtensionsObservable';\nimport type { ExtensionState, Options } from './types';\n\nconst useDeepCompareMemoize = <T>(value: T): T => {\n const ref = useRef<T>({} as T);\n\n if (!isEqual(value, ref.current)) {\n ref.current = value;\n }\n\n return ref.current;\n};\n\nexport const useExtensionsAll = <ContextT extends Context<{}> | null = null, AttributesT extends ExtensionAttributes = ExtensionAttributes>(\n extensionPoint: string,\n context: ContextT,\n options: Options,\n): ExtensionState<AttributesT> => {\n const [descriptorsState, setDescriptorsState] = useState<ExtensionState<AttributesT>>([[], [], true]);\n const cachedContext = useDeepCompareMemoize(context);\n const cachedOptions = useDeepCompareMemoize(options);\n\n useEffect(() => {\n const subscription = getValidatedExtensions<ContextT, AttributesT>(extensionPoint, cachedContext, cachedOptions).subscribe(\n (update) => {\n onDebug(({ debug }) => ({\n level: debug,\n message: `useExtensionsAll React hook received a new state`,\n components: 'useExtensionsAll',\n meta: {\n extensionPoint,\n context: cachedContext,\n update,\n },\n }));\n\n setDescriptorsState(update);\n },\n );\n\n return () => subscription.unsubscribe();\n }, [extensionPoint, cachedContext, cachedOptions]);\n\n return descriptorsState;\n};\n\nexport const useExtensions = <ContextT extends Context<{}> | null = null, AttributesT extends ExtensionAttributes = ExtensionAttributes>(\n extensionPoint: string,\n context: ContextT,\n options: Options,\n) => {\n const extensionsPayload = useExtensionsAll<ContextT, AttributesT>(extensionPoint, context, options);\n return extensionsPayload[0];\n};\n\nexport const useExtensionsUnsupported = <\n ContextT extends Context<{}> | null = null,\n AttributesU extends ExtensionAttributes = ExtensionAttributes,\n>(\n name: string,\n context: ContextT,\n options: Options,\n) => {\n const extensionsPayload = useExtensionsAll<ContextT, AttributesU>(name, context, options);\n return extensionsPayload[1];\n};\n\nexport const useExtensionsLoadingState = <\n ContextT extends Context<{}> | null = null,\n AttributesU extends ExtensionAttributes = ExtensionAttributes,\n>(\n name: string,\n context: ContextT,\n options: Options,\n) => {\n const extensionsPayload = useExtensionsAll<ContextT, AttributesU>(name, context, options);\n return extensionsPayload[2];\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWebPanelRenderer.js","sourceRoot":"","sources":["../../lib/useWebPanelRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAU,CAAC;AAErE,MAAM,eAAe,GAAG,CAAC,cAAiC,EAAE,EAAE;IAC1D,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,CAAC,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;IAClC,cAAc,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC5B,6FAA6F;QAC7F,iFAAiF;QACjF,IAAI,cAAc,CAAC,IAAI,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"useWebPanelRenderer.js","sourceRoot":"","sources":["../../lib/useWebPanelRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAU,CAAC;AAErE,MAAM,eAAe,GAAG,CAAC,cAAiC,EAAE,EAAE;IAC1D,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,CAAC,IAAI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M,CAAC,MAAM,EAAE,CAAC,CAAC;IAE7C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAEnC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;AACzD,CAAC,CAAC;AAIF,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,EAAE;IACzC,MAAM,GAAG,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAC3C,MAAM,MAAM,GAAG,WAAW,CACtB,CAAC,IAAI,EAAE,EAAE;;QACL,gDAAgD;QAChD,IAAI,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,0CAAE,0BAA0B,EAAE,CAAC;YAC3C,OAAO;QACX,CAAC;QAED,iCAAiC;QACjC,IAAI,IAAI,EAAE,CAAC;YACP,8BAA8B,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC3C,gDAAgD;YAC/C,IAAyB,CAAC,0BAA0B,GAAG,IAAI,CAAC;QACjE,CAAC;QAED,uFAAuF;QACvF,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;IACvB,CAAC,EACD,CAAC,IAAI,CAAC,CACT,CAAC;IAEF,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { onDebug } from '@atlassian/clientside-extensions-debug';\nimport { useCallback, useRef } from 'react';\n\nconst copyAttributes = ['type', 'src', 'nonce', 'noModule'] as const;\n\nconst evaluateScripts = (originalScript: HTMLScriptElement) => {\n const script = document.createElement('script');\n script.text = originalScript.text;\n copyAttributes.forEach((attr) => {\n // we cant just check if an attribute exists, as some of them are enforced to be \"properties\"\n // see: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce\n if (originalScript[attr]) {\n // @ts-expect-error We want to assign whatever here, typescript be quiet!\n script[attr] = originalScript[attr]!;\n }\n });\n\n try {\n document.head.appendChild(script);\n } catch (e) {\n onDebug(({ error }) => ({\n level: error,\n message: `An inline script in a WebPanel failed to execute.`,\n meta: {\n error: e,\n },\n }));\n }\n\n try {\n script.remove();\n } catch (e) {\n onDebug(({ error }) => ({\n level: error,\n message: `Failed to remove inline script associated with WebPanel.`,\n meta: {\n error: e,\n },\n }));\n }\n};\n\nconst injectAndEvaluateInlineScripts = (node: HTMLElement, html: string) => {\n const template = document.createElement('template');\n template.innerHTML = html;\n const scripts = template.content.querySelectorAll('script');\n scripts.forEach((script) => script.remove());\n\n node.appendChild(template.content);\n\n scripts.forEach((script) => evaluateScripts(script));\n};\n\ntype WebpanelRootNode = { __cse_webpanel_initialized: boolean } & HTMLElement;\n\nconst useWebPanelRenderer = (html: string) => {\n const ref = useRef<WebpanelRootNode>(null);\n const setRef = useCallback<(node: HTMLElement | null) => void>(\n (node) => {\n // eslint-disable-next-line no-underscore-dangle\n if (ref?.current?.__cse_webpanel_initialized) {\n return;\n }\n\n // where the actual work happens.\n if (node) {\n injectAndEvaluateInlineScripts(node, html);\n // eslint-disable-next-line no-underscore-dangle\n (node as WebpanelRootNode).__cse_webpanel_initialized = true;\n }\n\n // @ts-expect-error This is typed as a \"read-only\" property, but in fact it can be set.\n ref.current = node;\n },\n [html],\n );\n\n return setRef;\n};\n\nexport default useWebPanelRenderer;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SerializedDocument } from '@atlassian/clientside-extensions-schema';
|
|
3
|
-
export
|
|
3
|
+
export type ExtensionPointInfoProps = {
|
|
4
4
|
name: string;
|
|
5
5
|
schemaDocuments: {
|
|
6
6
|
schema: SerializedDocument;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionPointInfo.d.ts","sourceRoot":"","sources":["../../lib/ExtensionPointInfo.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExtensionPointInfo.d.ts","sourceRoot":"","sources":["../../lib/ExtensionPointInfo.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAG9C,OAAO,KAAK,EACR,kBAAkB,EAOrB,MAAM,yCAAyC,CAAC;AAIjD,MAAM,MAAM,uBAAuB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE;QAAE,MAAM,EAAE,kBAAkB,CAAC;QAAC,aAAa,EAAE,kBAAkB,CAAA;KAAE,CAAC;CACtF,CAAC;;AAkOF,wBAAwC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionsObservable.d.ts","sourceRoot":"","sources":["../../lib/ExtensionsObservable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EAEP,mBAAmB,EAMtB,MAAM,2CAA2C,CAAC;AAGnD,OAAO,KAAK,EAAE,UAAU,EAAY,MAAM,uCAAuC,CAAC;AAKlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAqO7E,eAAO,MAAM,6BAA6B,
|
|
1
|
+
{"version":3,"file":"ExtensionsObservable.d.ts","sourceRoot":"","sources":["../../lib/ExtensionsObservable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EAEP,mBAAmB,EAMtB,MAAM,2CAA2C,CAAC;AAGnD,OAAO,KAAK,EAAE,UAAU,EAAY,MAAM,uCAAuC,CAAC;AAKlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAqO7E,eAAO,MAAM,6BAA6B,GAAI,QAAQ,SAAS,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,WAAW,SAAS,mBAAmB,kBACtG,MAAM,WACb,QAAQ,KAClB,UAAU,CAAC,oBAAoB,CAAC,WAAW,CAAC,CA0F9C,CAAC;AAmHF,eAAO,MAAM,sBAAsB,GAAI,QAAQ,SAAS,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,WAAW,SAAS,mBAAmB,sBAC3F,MAAM,WACjB,QAAQ,WACR,OAAO,KACjB,UAAU,CAAC,cAAc,CAAC,WAAW,CAAC,CAmDxC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type DebugToggleHook = [boolean, (value: boolean) => void];
|
|
2
2
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/debug/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/debug/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDebug.d.ts","sourceRoot":"","sources":["../../../lib/debug/useDebug.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,QAAA,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"useDebug.d.ts","sourceRoot":"","sources":["../../../lib/debug/useDebug.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,QAAA,MAAM,QAAQ,QAAO,eAWpB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDiscovery.d.ts","sourceRoot":"","sources":["../../../lib/debug/useDiscovery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,QAAA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"useDiscovery.d.ts","sourceRoot":"","sources":["../../../lib/debug/useDiscovery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,QAAA,MAAM,YAAY,QAAO,eAWxB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLogging.d.ts","sourceRoot":"","sources":["../../../lib/debug/useLogging.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,QAAA,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"useLogging.d.ts","sourceRoot":"","sources":["../../../lib/debug/useLogging.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,QAAA,MAAM,UAAU,QAAO,eAWtB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useValidation.d.ts","sourceRoot":"","sources":["../../../lib/debug/useValidation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,QAAA,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"useValidation.d.ts","sourceRoot":"","sources":["../../../lib/debug/useValidation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,QAAA,MAAM,aAAa,QAAO,eAWzB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { FunctionComponent } from 'react';
|
|
|
2
2
|
import type { AsyncPanelExtension } from '@atlassian/clientside-extensions';
|
|
3
3
|
import type { Context } from '@atlassian/clientside-extensions-registry';
|
|
4
4
|
import type { PanelHandlerProps } from './PanelHandler';
|
|
5
|
-
export
|
|
5
|
+
export type AsyncPanelRenderExtension = () => Promise<{
|
|
6
6
|
default: AsyncPanelExtension.AsyncPanelRenderExtension;
|
|
7
7
|
__esModule: boolean;
|
|
8
8
|
}>;
|