@texonom/nreact 1.5.2 → 1.5.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/components/audio.tsx","../src/icons/file-icon.tsx","../src/components/file.tsx","../src/components/google-drive.tsx","../../../node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js","../src/components/page-aside.tsx","../src/components/sync-pointer-block.tsx","../src/icons/link-icon.tsx","../src/block.tsx","../src/renderer.tsx"],"sourcesContent":["import React from 'react'\n\nimport { AudioBlock } from '@texonom/ntypes'\n\nimport { useNotionContext } from '../context'\n\nexport const Audio: React.FC<{\n block: AudioBlock\n className?: string\n}> = ({ block, className }) => {\n const { recordMap } = useNotionContext()\n const source = recordMap.signed_urls[block.id] || block.properties?.source?.[0]?.[0]\n\n return (\n <div className={`notion-audio ${className || ''}`}>\n <audio controls preload='none' src={source} />\n </div>\n )\n}\n","import React from 'react'\n\nexport const FileIcon = props => {\n const { className, ...rest } = props\n return (\n <svg className={className} {...rest} viewBox='0 0 30 30'>\n <path d='M22,8v12c0,3.866-3.134,7-7,7s-7-3.134-7-7V8c0-2.762,2.238-5,5-5s5,2.238,5,5v12c0,1.657-1.343,3-3,3s-3-1.343-3-3V8h-2v12c0,2.762,2.238,5,5,5s5-2.238,5-5V8c0-3.866-3.134-7-7-7S6,4.134,6,8v12c0,4.971,4.029,9,9,9s9-4.029,9-9V8H22z'></path>\n </svg>\n )\n}\n","import React from 'react'\n\nimport { FileBlock } from '@texonom/ntypes'\n\nimport { useNotionContext } from '../context'\nimport { FileIcon } from '../icons/file-icon'\nimport { Text } from './text'\n\nexport const File: React.FC<{\n block: FileBlock\n className?: string\n}> = ({ block, className }) => {\n const { components, recordMap } = useNotionContext()\n const source = recordMap.signed_urls[block.id] || block.properties?.source?.[0]?.[0]\n\n return (\n <div className={`notion-file ${className || ''}`}>\n <components.Link className='notion-file-link' href={source} target='_blank' rel='noopener noreferrer'>\n <FileIcon className='notion-file-icon' />\n\n <div className='notion-file-info'>\n <div className='notion-file-title'>\n <Text value={block.properties?.title || [['File']]} block={block} />\n </div>\n\n {block.properties?.size && (\n <div className='notion-file-size'>\n <Text value={block.properties.size} block={block} />\n </div>\n )}\n </div>\n </components.Link>\n </div>\n )\n}\n","import React from 'react'\n\nimport { GoogleDriveBlock } from '@texonom/ntypes'\n\nimport { useNotionContext } from '../context'\nimport { GracefulImage } from './graceful-image'\n\nexport const GoogleDrive: React.FC<{\n block: GoogleDriveBlock\n className?: string\n}> = ({ block, className }) => {\n const { components, mapImageUrl } = useNotionContext()\n const properties = block.format?.drive_properties\n if (!properties) return null\n let domain\n\n try {\n const url = new URL(properties.url)\n domain = url.hostname\n } catch (err) {\n // ignore invalid urls for robustness\n }\n\n return (\n <div className={`notion-google-drive ${className || ''}`}>\n <components.Link className='notion-google-drive-link' href={properties.url} target='_blank' rel='noopener noreferrer'>\n <div className='notion-google-drive-preview'>\n <GracefulImage\n src={mapImageUrl(properties.thumbnail, block)}\n alt={properties.title || 'Google Drive Document'}\n loading='lazy'\n />\n </div>\n\n <div className='notion-google-drive-body'>\n {properties.title && <div className='notion-google-drive-body-title'>{properties.title}</div>}\n\n {/* TODO: re-add last modified time with alternative to timeago.js */}\n {/* {properties.modified_time && (\n <div className='notion-google-drive-body-modified-time'>\n Last modified{' '}\n {properties.user_name ? `by ${properties.user_name} ` : ''}\n {timeago(properties.modified_time)}\n </div>\n )} */}\n\n {properties.icon && domain && (\n <div className='notion-google-drive-body-source'>\n {properties.icon && (\n <div\n className='notion-google-drive-body-source-icon'\n style={{\n backgroundImage: `url(${properties.icon})`\n }}\n />\n )}\n\n {domain && <div className='notion-google-drive-body-source-domain'>{domain}</div>}\n </div>\n )}\n </div>\n </components.Link>\n </div>\n )\n}\n","/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = throttle;\n","import React from 'react'\n\nimport throttle from 'lodash.throttle'\nimport { TableOfContentsEntry, uuidToId } from '@texonom/nutils'\n\nexport const PageAside: React.FC<{\n toc: Array<TableOfContentsEntry>\n activeSection: string | null\n setActiveSection: (activeSection: string | null) => unknown\n hasToc: boolean\n hasAside: boolean\n pageAside?: React.ReactNode\n className?: string\n}> = ({ toc, activeSection, setActiveSection, pageAside, hasToc, hasAside, className }) => {\n const throttleMs = 100\n const actionSectionScrollSpy = React.useMemo(\n () =>\n throttle(() => {\n const sections = document.getElementsByClassName('notion-h')\n\n let prevBBox: DOMRect = null\n let currentSectionId = activeSection\n\n for (let i = 0; i < sections.length; ++i) {\n const section = sections[i]\n if (!section || !(section instanceof Element)) continue\n\n if (!currentSectionId) currentSectionId = section.getAttribute('data-id')\n\n const bbox = section.getBoundingClientRect()\n const prevHeight = prevBBox ? bbox.top - prevBBox.bottom : 0\n const offset = Math.max(150, prevHeight / 4)\n\n // GetBoundingClientRect returns values relative to the viewport\n if (bbox.top - offset < 0) {\n currentSectionId = section.getAttribute('data-id')\n\n prevBBox = bbox\n continue\n }\n\n // No need to continue loop, if last element has been detected\n break\n }\n\n setActiveSection(currentSectionId)\n }, throttleMs),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n // explicitly not taking a dependency on activeSection\n setActiveSection\n ]\n )\n\n React.useEffect(() => {\n if (!hasToc) return\n\n window.addEventListener('scroll', actionSectionScrollSpy)\n\n actionSectionScrollSpy()\n\n return () => {\n window.removeEventListener('scroll', actionSectionScrollSpy)\n }\n }, [hasToc, actionSectionScrollSpy])\n\n if (!hasAside) return null\n\n return (\n <aside className={`notion-aside ${className || ''}`}>\n {hasToc && (\n <div className='notion-aside-table-of-contents'>\n <div className='notion-aside-table-of-contents-header'>Table of Contents</div>\n\n <nav className='notion-table-of-contents'>\n {toc.map(tocItem => {\n const id = uuidToId(tocItem.id)\n\n return (\n <a\n key={id}\n href={`#${id}`}\n className={`notion-table-of-contents-item\n notion-table-of-contents-item-indent-level-${tocItem.indentLevel}\n ${activeSection === id && 'notion-table-of-contents-active-item'}`}>\n <span\n className='notion-table-of-contents-item-body'\n style={{\n display: 'inline-block',\n marginLeft: tocItem.indentLevel * 16\n }}>\n {tocItem.text}\n </span>\n </a>\n )\n })}\n </nav>\n </div>\n )}\n\n {pageAside}\n </aside>\n )\n}\n","import React from 'react'\n\nimport { NotionBlockRenderer } from '../renderer'\n\nimport type { Block as BlockType, SyncPointerBlock as SyncPointerBlockType } from '@texonom/ntypes'\n\nexport const SyncPointerBlock: React.FC<{\n block: BlockType\n level: number\n}> = ({ block, level }) => {\n if (!block) {\n if (process.env.NODE_ENV !== 'production') console.warn('missing sync pointer block', block.id)\n\n return null\n }\n\n const syncPointerBlock = block as SyncPointerBlockType\n const referencePointerId = syncPointerBlock?.format?.transclusion_reference_pointer?.id\n\n if (!referencePointerId) return null\n\n return <NotionBlockRenderer key={referencePointerId} level={level} blockId={referencePointerId} />\n}\n","import React from 'react'\n\nexport const LinkIcon = props => {\n const { className, ...rest } = props\n return (\n <svg className={className} {...rest} viewBox='0 0 16 16' width='16' height='16'>\n <path\n fillRule='evenodd'\n d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'\n />\n </svg>\n )\n}\n","import React from 'react'\n\nimport {\n getBlockCollectionId,\n getBlockIcon,\n getBlockParentPage,\n getPageTableOfContents,\n getTextContent,\n uuidToId\n} from '@texonom/nutils'\n\nimport { AssetWrapper } from './components/asset-wrapper'\nimport { Audio } from './components/audio'\nimport { EOI } from './components/eoi'\nimport { File } from './components/file'\nimport { GoogleDrive } from './components/google-drive'\nimport { LazyImage } from './components/lazy-image'\nimport { PageAside } from './components/page-aside'\nimport { PageIcon } from './components/page-icon'\nimport { PageTitle } from './components/page-title'\nimport { SyncPointerBlock } from './components/sync-pointer-block'\nimport { Text } from './components/text'\nimport { useNotionContext } from './context'\nimport { LinkIcon } from './icons/link-icon'\nimport { getListNumber, isUrl } from './utils'\n\nimport type {\n Block as BlockType,\n PageBlock,\n GoogleDriveBlock,\n AudioBlock,\n FileBlock,\n EquationBlock,\n CollectionViewPageBlock,\n CodeBlock,\n TableBlock\n} from '@texonom/ntypes'\ninterface BlockProps {\n block: BlockType\n level: number\n\n className?: string\n bodyClassName?: string\n\n header?: React.ReactNode\n footer?: React.ReactNode\n pageHeader?: React.ReactNode\n pageFooter?: React.ReactNode\n pageTitle?: React.ReactNode\n pageAside?: React.ReactNode\n pageCover?: React.ReactNode\n\n hideBlockId?: boolean\n disableHeader?: boolean\n\n children?: React.ReactNode\n}\n\n// TODO: use react state instead of a global for this\nconst tocIndentLevelCache: {\n [blockId: string]: number\n} = {}\n\nconst pageCoverStyleCache: Record<string, object> = {}\n\nexport const Block: React.FC<BlockProps> = props => {\n const ctx = useNotionContext()\n const {\n components,\n fullPage,\n recordMap,\n mapPageUrl,\n mapImageUrl,\n showTableOfContents,\n minTableOfContentsItems,\n defaultPageIcon,\n defaultPageCover,\n defaultPageCoverPosition\n } = ctx\n\n const [activeSection, setActiveSection] = React.useState(null)\n\n const {\n block,\n children,\n level,\n className,\n bodyClassName,\n header,\n footer,\n pageHeader,\n pageFooter,\n pageTitle,\n pageAside,\n pageCover,\n hideBlockId,\n disableHeader\n } = props\n\n if (!block) return null\n\n // ugly hack to make viewing raw collection views work properly\n // e.g., 6d886ca87ab94c21a16e3b82b43a57fb\n if (level === 0 && block.type === 'collection_view') {\n const view_block = block as unknown as CollectionViewPageBlock\n view_block.type = 'collection_view_page'\n }\n\n const blockId = hideBlockId ? 'notion-block' : `notion-block-${uuidToId(block.id)}`\n\n switch (block.type) {\n case 'collection_view_page':\n // fallthrough\n case 'page':\n if (level === 0) {\n const {\n page_icon = defaultPageIcon,\n page_cover = defaultPageCover,\n page_cover_position = defaultPageCoverPosition,\n page_full_width,\n page_small_text\n } = block.format || {}\n\n if (fullPage) {\n const properties =\n block.type === 'page'\n ? block.properties\n : {\n title: recordMap.collection[getBlockCollectionId(block, recordMap)]?.value?.name\n }\n\n const coverPosition = (1 - (page_cover_position || 0.5)) * 100\n const pageCoverObjectPosition = `center ${coverPosition}%`\n let pageCoverStyle = pageCoverStyleCache[pageCoverObjectPosition]\n if (!pageCoverStyle)\n pageCoverStyle = pageCoverStyleCache[pageCoverObjectPosition] = {\n objectPosition: pageCoverObjectPosition\n }\n\n const pageIcon = getBlockIcon(block, recordMap) ?? defaultPageIcon\n const isPageIconUrl = pageIcon && isUrl(pageIcon)\n\n const toc = getPageTableOfContents(block as PageBlock, recordMap)\n\n const hasToc = showTableOfContents && toc.length >= minTableOfContentsItems\n const hasAside = (hasToc || pageAside) && !page_full_width\n const hasPageCover = pageCover || page_cover\n\n return (\n <div className={`notion notion-app ${blockId} ${className || ''}`}>\n <div className='notion-viewport' />\n\n <div className='notion-frame'>\n {!disableHeader && <components.Header block={block} />}\n {header}\n\n <div className='notion-page-scroller'>\n {hasPageCover &&\n (pageCover ? (\n pageCover\n ) : (\n <div className='notion-page-cover-wrapper'>\n <LazyImage\n src={mapImageUrl(page_cover, block)}\n alt={getTextContent(properties?.title)}\n priority={true}\n className='notion-page-cover'\n style={pageCoverStyle}\n />\n </div>\n ))}\n\n <main\n className={`notion-page\n ${hasPageCover ? 'notion-page-has-cover' : 'notion-page-no-cover'}\n ${page_icon ? 'notion-page-has-icon' : 'notion-page-no-icon'}\n ${isPageIconUrl ? 'notion-page-has-image-icon' : 'notion-page-has-text-icon'}\n notion-full-page\n ${page_full_width && 'notion-full-width'}\n ${page_small_text && 'notion-small-text'}\n ${bodyClassName}`}>\n {page_icon && <PageIcon block={block} defaultIcon={defaultPageIcon} inline={false} />}\n\n {pageHeader}\n\n <h1 className='notion-title'>{pageTitle ?? <Text value={properties?.title} block={block} />}</h1>\n\n {(block.type === 'collection_view_page' ||\n (block.type === 'page' && block.parent_table === 'collection')) && (\n <components.Collection block={block} ctx={ctx} />\n )}\n\n {block.type !== 'collection_view_page' && (\n <div\n className={`notion-page-content\n ${hasAside && 'notion-page-content-has-aside'}\n ${hasToc && 'notion-page-content-has-toc'}`}>\n <article className='notion-page-content-inner'>{children}</article>\n\n {hasAside && (\n <PageAside\n toc={toc}\n activeSection={activeSection}\n setActiveSection={setActiveSection}\n hasToc={hasToc}\n hasAside={hasAside}\n pageAside={pageAside}\n />\n )}\n </div>\n )}\n\n {pageFooter}\n </main>\n\n {footer}\n </div>\n </div>\n </div>\n )\n } else {\n return (\n <main\n className={`notion\n notion-page\n ${page_full_width && 'notion-full-width'}\n ${page_small_text && 'notion-small-text'}\n ${blockId}\n ${className || ''}\n ${bodyClassName}`}>\n <div className='notion-viewport' />\n\n {pageHeader}\n\n {(block.type === 'collection_view_page' || (block.type === 'page' && block.parent_table === 'collection')) && (\n <components.Collection block={block} ctx={ctx} />\n )}\n\n {block.type !== 'collection_view_page' && children}\n\n {pageFooter}\n </main>\n )\n }\n } else {\n const blockColor = block.format?.block_color\n\n return (\n <components.PageLink\n className={`notion-page-link ${blockColor && `notion-${blockColor}`} ${blockId}`}\n href={mapPageUrl(block.id)}>\n <PageTitle block={block} />\n </components.PageLink>\n )\n }\n\n case 'header':\n // fallthrough\n case 'sub_header':\n // fallthrough\n case 'sub_sub_header': {\n if (!block.properties) return null\n\n const blockColor = block.format?.block_color\n const id = uuidToId(block.id)\n const title = getTextContent(block.properties.title) || `Notion Header ${id}`\n\n // we use a cache here because constructing the ToC is non-trivial\n let indentLevel = tocIndentLevelCache[block.id]\n let indentLevelClass: string\n\n if (indentLevel === undefined) {\n const page = getBlockParentPage(block, recordMap)\n\n if (page) {\n const toc = getPageTableOfContents(page, recordMap)\n const tocItem = toc.find(tocItem => tocItem.id === block.id)\n\n if (tocItem) {\n indentLevel = tocItem.indentLevel\n tocIndentLevelCache[block.id] = indentLevel\n }\n }\n }\n\n if (indentLevel !== undefined) indentLevelClass = `notion-h-indent-${indentLevel}`\n\n const isH1 = block.type === 'header'\n const isH2 = block.type === 'sub_header'\n const isH3 = block.type === 'sub_sub_header'\n\n const classNameStr = `${isH1 && 'notion-h notion-h1'}\n ${isH2 && 'notion-h notion-h2'}\n ${isH3 && 'notion-h notion-h3'}\n ${blockColor && `notion-${blockColor}`}\n ${indentLevelClass},\n ${blockId}`\n\n const innerHeader = (\n <span>\n <div id={id} className='notion-header-anchor' />\n {!block.format?.toggleable && (\n <a className='notion-hash-link' href={`#${id}`} title={title}>\n <LinkIcon />\n </a>\n )}\n\n <span className='notion-h-title'>\n <Text value={block.properties.title} block={block} />\n </span>\n </span>\n )\n let headerBlock = null\n\n //page title takes the h1 so all header blocks are greater\n if (isH1)\n headerBlock = (\n <h2 className={classNameStr} data-id={id}>\n {innerHeader}\n </h2>\n )\n else if (isH2)\n headerBlock = (\n <h3 className={classNameStr} data-id={id}>\n {innerHeader}\n </h3>\n )\n else\n headerBlock = (\n <h4 className={classNameStr} data-id={id}>\n {innerHeader}\n </h4>\n )\n\n if (block.format?.toggleable)\n return (\n <details className={`notion-toggle ${blockId}`}>\n <summary>{headerBlock}</summary>\n <div>{children}</div>\n </details>\n )\n else return headerBlock\n }\n\n case 'divider':\n return <hr className={`notion-hr ${blockId}`} />\n\n case 'text': {\n if (!block.properties && !block.content?.length) return <div className={`notion-blank ${blockId}`}>&nbsp;</div>\n\n const blockColor = block.format?.block_color\n\n return (\n <div className={`notion-text ${blockColor && `notion-${blockColor}`} ${blockId}`}>\n {block.properties?.title && <Text value={block.properties.title} block={block} />}\n\n {children && <div className='notion-text-children'>{children}</div>}\n </div>\n )\n }\n\n case 'bulleted_list':\n // fallthrough\n case 'numbered_list': {\n const wrapList = (content: React.ReactNode, start?: number) =>\n block.type === 'bulleted_list' ? (\n <ul className={`notion-list notion-list-disc ${blockId}`}>{content}</ul>\n ) : (\n <ol start={start} className={`notion-list notion-list-numbered ${blockId}`}>\n {content}\n </ol>\n )\n\n let output: React.JSX.Element | null = null\n\n if (block.content)\n output = (\n <>\n {block.properties && (\n <li>\n <Text value={block.properties.title} block={block} />\n </li>\n )}\n {wrapList(children)}\n </>\n )\n else\n output = block.properties ? (\n <li>\n <Text value={block.properties.title} block={block} />\n </li>\n ) : null\n\n const isTopLevel = block.type !== recordMap.block[block.parent_id]?.value?.type\n const start = getListNumber(block.id, recordMap.block)\n\n return isTopLevel ? wrapList(output, start) : output\n }\n\n case 'embed':\n return <components.Embed blockId={blockId} block={block} />\n case 'tweet':\n // fallthrough\n case 'maps':\n // fallthrough\n case 'pdf':\n // fallthrough\n case 'figma':\n // fallthrough\n case 'typeform':\n // fallthrough\n case 'codepen':\n // fallthrough\n case 'excalidraw':\n // fallthrough\n case 'image':\n // fallthrough\n case 'gist':\n // fallthrough\n case 'video':\n return <AssetWrapper blockId={blockId} block={block} />\n\n case 'drive': {\n const properties = block.format?.drive_properties\n if (!properties)\n if (block.format?.display_source)\n //check if this drive actually needs to be embeded ex. google sheets.\n return <AssetWrapper blockId={blockId} block={block} />\n\n return <GoogleDrive block={block as GoogleDriveBlock} className={blockId} />\n }\n\n case 'audio':\n return <Audio block={block as AudioBlock} className={blockId} />\n\n case 'file':\n return <File block={block as FileBlock} className={blockId} />\n\n case 'equation':\n return <components.Equation block={block as EquationBlock} inline={false} className={blockId} />\n\n case 'code':\n return <components.Code block={block as CodeBlock} />\n\n case 'column_list':\n return <div className={`notion-row ${blockId}`}>{children}</div>\n\n case 'column': {\n // note: notion uses 46px\n const spacerWidth = `min(32px, 4vw)`\n const ratio = block.format?.column_ratio || 0.5\n const parent = recordMap.block[block.parent_id]?.value\n const columns = parent?.content?.length || Math.max(2, Math.ceil(1.0 / ratio))\n\n const width = `calc((100% - (${columns - 1} * ${spacerWidth})) * ${ratio})`\n const style = { width }\n\n return (\n <>\n <div className={`notion-column ${blockId}`} style={style}>\n {children}\n </div>\n\n <div className='notion-spacer' />\n </>\n )\n }\n\n case 'quote': {\n if (!block.properties) return null\n\n const blockColor = block.format?.block_color\n\n return (\n <blockquote className={`notion-quote ${blockColor && `notion-${blockColor}`} ${blockId}`}>\n <div>\n <Text value={block.properties.title} block={block} />\n </div>\n {children}\n </blockquote>\n )\n }\n\n case 'collection_view':\n return <components.Collection block={block} className={blockId} ctx={ctx} />\n\n case 'callout':\n if (components.Callout) return <components.Callout block={block} className={blockId} />\n else\n return (\n <div\n className={`notion-callout ${block.format?.block_color && `notion-${block.format?.block_color}_co`} ${blockId}`}>\n <PageIcon block={block} />\n\n <div className='notion-callout-text'>\n <Text value={block.properties?.title} block={block} />\n {children}\n </div>\n </div>\n )\n\n case 'bookmark': {\n if (!block.properties) return null\n\n const link = block.properties.link\n if (!link || !link[0]?.[0]) return null\n\n let title = getTextContent(block.properties.title)\n if (!title) title = getTextContent(link)\n\n if (title)\n if (title.startsWith('http'))\n try {\n const url = new URL(title)\n title = url.hostname\n } catch (err) {\n // ignore invalid links\n }\n\n return (\n <components.Link\n target='_blank'\n rel='noopener noreferrer'\n className={`notion-bookmark ${block.format?.block_color && `notion-${block.format.block_color}`} ${blockId}`}\n href={link[0][0]}>\n <div>\n {title && (\n <div className='notion-bookmark-title'>\n <Text value={[[title]]} block={block} />\n </div>\n )}\n\n {block.properties?.description && (\n <div className='notion-bookmark-description'>\n <Text value={block.properties?.description} block={block} />\n </div>\n )}\n\n <div className='notion-bookmark-link'>\n {block.format?.bookmark_icon && (\n <div className='notion-bookmark-link-icon'>\n <LazyImage\n src={mapImageUrl(block.format?.bookmark_icon, block)}\n alt={title}\n onError={e => {\n const target = e.currentTarget as HTMLImageElement\n target.style.display = 'none'\n }}\n />\n </div>\n )}\n\n <div className='notion-bookmark-link-text'>\n <Text value={link} block={block} />\n </div>\n </div>\n </div>\n\n {block.format?.bookmark_cover && (\n <div className='notion-bookmark-image'>\n <LazyImage\n src={mapImageUrl(block.format?.bookmark_cover, block)}\n alt={getTextContent(block.properties?.title)}\n style={{\n objectFit: 'cover'\n }}\n onError={e => {\n const target = e.currentTarget as HTMLImageElement\n target.style.display = 'none'\n }}\n />\n </div>\n )}\n </components.Link>\n )\n }\n\n case 'toggle':\n return (\n <details className={`notion-toggle ${blockId}`}>\n <summary>\n <Text value={block.properties?.title} block={block} />\n </summary>\n\n <div>{children}</div>\n </details>\n )\n\n case 'table_of_contents': {\n const page = getBlockParentPage(block, recordMap)\n if (!page) return null\n\n const toc = getPageTableOfContents(page, recordMap)\n const blockColor = block.format?.block_color\n\n return (\n <div className={`notion-table-of-contents ${blockColor && `notion-${blockColor}`} ${blockId}`}>\n {toc.map(tocItem => (\n <a key={tocItem.id} href={`#${uuidToId(tocItem.id)}`} className='notion-table-of-contents-item'>\n <span\n className='notion-table-of-contents-item-body'\n style={{\n display: 'inline-block',\n marginLeft: tocItem.indentLevel * 24\n }}>\n {tocItem.text}\n </span>\n </a>\n ))}\n </div>\n )\n }\n\n case 'to_do': {\n const isChecked = block.properties?.checked?.[0]?.[0] === 'Yes'\n\n return (\n <div className={`notion-to-do ${blockId}`}>\n <div className='notion-to-do-item'>\n <components.Checkbox blockId={blockId} isChecked={isChecked} />\n\n <div className={`notion-to-do-body ${isChecked && `notion-to-do-checked`}`}>\n <Text value={block.properties?.title} block={block} />\n </div>\n </div>\n\n <div className='notion-to-do-children'>{children}</div>\n </div>\n )\n }\n\n case 'transclusion_container':\n return <div className={`notion-sync-block ${blockId}`}>{children}</div>\n\n case 'transclusion_reference':\n return <SyncPointerBlock block={block} level={level + 1} {...props} />\n\n case 'alias': {\n const blockPointerId = block?.format?.alias_pointer?.id\n const linkedBlock = recordMap.block[blockPointerId]?.value\n if (!linkedBlock) {\n console.debug('\"alias\" missing block', blockPointerId)\n return null\n }\n\n return (\n <components.PageLink className={`notion-page-link ${blockPointerId}}`} href={mapPageUrl(blockPointerId)}>\n <PageTitle block={linkedBlock} />\n </components.PageLink>\n )\n }\n\n case 'table':\n return (\n <table className={`notion-simple-table ${blockId}`}>\n <tbody>{children}</tbody>\n </table>\n )\n\n case 'table_row': {\n const tableBlock = recordMap.block[block.parent_id]?.value as TableBlock\n const order = tableBlock.format?.table_block_column_order\n const formatMap = tableBlock.format?.table_block_column_format\n const backgroundColor = block.format?.block_color\n\n if (!tableBlock || !order) return null\n\n return (\n <tr className={`notion-simple-table-row ${backgroundColor && `notion-${backgroundColor}`} ${blockId}`}>\n {order.map(column => {\n const color = formatMap?.[column]?.color\n\n return (\n <td\n key={column}\n className={color ? `notion-${color}` : ''}\n style={{\n width: formatMap?.[column]?.width || 120\n }}>\n <div className='notion-simple-table-cell'>\n <Text value={block.properties?.[column] || [['ㅤ']]} block={block} />\n </div>\n </td>\n )\n })}\n </tr>\n )\n }\n\n case 'external_object_instance':\n return <EOI block={block} className={blockId} />\n\n default:\n if (process.env.NODE_ENV !== 'production')\n console.debug('Unsupported type ' + (block as BlockType).type, JSON.stringify(block, null, 2))\n\n return <div />\n }\n}\n","import React from 'react'\n\nimport mediumZoom from '@fisch0920/medium-zoom'\nimport type { ExtendedRecordMap } from '@texonom/ntypes'\n\nimport { Block } from './block'\nimport { NotionContextProvider, useNotionContext } from './context'\nimport { MapImageUrlFn, MapPageUrlFn, NotionComponents, SearchNotionFn } from './types'\n\nexport const NotionRenderer: React.FC<{\n recordMap: ExtendedRecordMap\n components?: Partial<NotionComponents>\n\n mapPageUrl?: MapPageUrlFn\n mapImageUrl?: MapImageUrlFn\n searchNotion?: SearchNotionFn\n isShowingSearch?: boolean\n onHideSearch?: () => void\n\n rootPageId?: string\n rootDomain?: string\n rootSpaceId?: string\n\n // set fullPage to false to render page content only\n // this will remove the header, cover image, and footer\n fullPage?: boolean\n\n darkMode?: boolean\n previewImages?: boolean\n forceCustomImages?: boolean\n showCollectionViewDropdown?: boolean\n linkTableTitleProperties?: boolean\n isLinkCollectionToUrlProperty?: boolean\n isImageZoomable?: boolean\n\n showTableOfContents?: boolean\n minTableOfContentsItems?: number\n\n defaultPageIcon?: string\n defaultPageCover?: string\n defaultPageCoverPosition?: number\n\n className?: string\n bodyClassName?: string\n\n header?: React.ReactNode\n footer?: React.ReactNode\n pageHeader?: React.ReactNode\n pageFooter?: React.ReactNode\n pageTitle?: React.ReactNode\n pageAside?: React.ReactNode\n pageCover?: React.ReactNode\n\n blockId?: string\n hideBlockId?: boolean\n disableHeader?: boolean\n}> = ({\n components,\n recordMap,\n mapPageUrl,\n mapImageUrl,\n searchNotion,\n isShowingSearch,\n onHideSearch,\n fullPage,\n rootPageId,\n rootDomain,\n rootSpaceId,\n darkMode,\n previewImages,\n forceCustomImages,\n showCollectionViewDropdown,\n linkTableTitleProperties,\n isLinkCollectionToUrlProperty,\n isImageZoomable = true,\n showTableOfContents,\n minTableOfContentsItems,\n defaultPageIcon,\n defaultPageCover,\n defaultPageCoverPosition,\n ...rest\n}) => {\n const zoom = React.useMemo(\n () =>\n typeof window !== 'undefined' &&\n mediumZoom({\n background: 'rgba(0, 0, 0, 0.8)',\n minZoomScale: 2.0,\n margin: getMediumZoomMargin()\n }),\n []\n )\n\n return (\n <NotionContextProvider\n components={components}\n recordMap={recordMap}\n mapPageUrl={mapPageUrl}\n mapImageUrl={mapImageUrl}\n searchNotion={searchNotion}\n isShowingSearch={isShowingSearch}\n onHideSearch={onHideSearch}\n fullPage={fullPage}\n rootPageId={rootPageId}\n rootDomain={rootDomain}\n rootSpaceId={rootSpaceId}\n darkMode={darkMode}\n previewImages={previewImages}\n forceCustomImages={forceCustomImages}\n showCollectionViewDropdown={showCollectionViewDropdown}\n linkTableTitleProperties={linkTableTitleProperties}\n isLinkCollectionToUrlProperty={isLinkCollectionToUrlProperty}\n showTableOfContents={showTableOfContents}\n minTableOfContentsItems={minTableOfContentsItems}\n defaultPageIcon={defaultPageIcon}\n defaultPageCover={defaultPageCover}\n defaultPageCoverPosition={defaultPageCoverPosition}\n zoom={isImageZoomable ? zoom : null}>\n <NotionBlockRenderer {...rest} />\n </NotionContextProvider>\n )\n}\n\nexport const NotionBlockRenderer: React.FC<{\n className?: string\n bodyClassName?: string\n header?: React.ReactNode\n footer?: React.ReactNode\n disableHeader?: boolean\n\n blockId?: string\n hideBlockId?: boolean\n level?: number\n}> = ({ level = 0, blockId, ...props }) => {\n const { recordMap } = useNotionContext()\n const id = blockId || Object.keys(recordMap.block)[0]\n const block = recordMap.block[id]?.value\n\n if (!block) {\n if (process.env.NODE_ENV !== 'production') console.warn('missing block', blockId)\n\n return null\n }\n\n return (\n <Block key={id} level={level} block={block} {...props}>\n {block?.content?.map(contentBlockId => (\n <NotionBlockRenderer key={contentBlockId} blockId={contentBlockId} level={level + 1} {...props} />\n ))}\n </Block>\n )\n}\n\nfunction getMediumZoomMargin() {\n const width = window.innerWidth\n\n if (width < 500) return 8\n else if (width < 800) return 20\n else if (width < 1280) return 30\n else if (width < 1600) return 40\n else if (width < 1920) return 48\n else return 72\n}\n"],"names":["Audio","block","className","recordMap","useNotionContext","source","_c","_b","_a","React","FileIcon","props","rest","__objRest","__spreadProps","__spreadValues","File","components","Text","_d","_e","GoogleDrive","mapImageUrl","properties","domain","err","GracefulImage","FUNC_ERROR_TEXT","NAN","symbolTag","reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","freeGlobal","global","freeSelf","root","objectProto","objectToString","nativeMax","nativeMin","now","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","toNumber","isObject","invokeFunc","time","args","thisArg","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","shouldInvoke","trailingEdge","cancel","flush","debounced","isInvoking","throttle","value","type","isObjectLike","isSymbol","other","isBinary","lodash_throttle","PageAside","toc","activeSection","setActiveSection","pageAside","hasToc","hasAside","actionSectionScrollSpy","sections","prevBBox","currentSectionId","i","section","bbox","prevHeight","offset","tocItem","id","uuidToId","SyncPointerBlock","level","syncPointerBlock","referencePointerId","NotionBlockRenderer","LinkIcon","tocIndentLevelCache","pageCoverStyleCache","Block","ctx","fullPage","mapPageUrl","showTableOfContents","minTableOfContentsItems","defaultPageIcon","defaultPageCover","defaultPageCoverPosition","children","bodyClassName","header","footer","pageHeader","pageFooter","pageTitle","pageCover","hideBlockId","disableHeader","view_block","blockId","page_icon","page_cover","page_cover_position","page_full_width","page_small_text","getBlockCollectionId","pageCoverObjectPosition","pageCoverStyle","pageIcon","getBlockIcon","isPageIconUrl","isUrl","getPageTableOfContents","hasPageCover","LazyImage","getTextContent","PageIcon","blockColor","PageTitle","title","indentLevel","indentLevelClass","page","getBlockParentPage","isH1","isH2","isH3","classNameStr","innerHeader","_f","headerBlock","_g","_h","_i","_j","wrapList","content","start","output","isTopLevel","_l","_k","getListNumber","AssetWrapper","_m","_n","spacerWidth","ratio","_o","parent","_p","style","_q","_r","_s","_t","_u","link","_v","_w","_x","_y","_z","_A","e","target","_B","_C","_D","_E","_F","isChecked","_I","_H","_G","_J","blockPointerId","_L","_K","linkedBlock","_M","tableBlock","_N","order","_O","formatMap","_P","backgroundColor","_Q","column","color","EOI","NotionRenderer","searchNotion","isShowingSearch","onHideSearch","rootPageId","rootDomain","rootSpaceId","darkMode","previewImages","forceCustomImages","showCollectionViewDropdown","linkTableTitleProperties","isLinkCollectionToUrlProperty","isImageZoomable","zoom","mediumZoom","getMediumZoomMargin","NotionContextProvider","contentBlockId","width"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMO,MAAMA,KAGR,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgB;;AAC7B,QAAM,EAAE,WAAAC,EAAA,IAAcC,GAAA,GAChBC,IAASF,EAAU,YAAYF,EAAM,EAAE,OAAKK,KAAAC,KAAAC,IAAAP,EAAM,eAAN,gBAAAO,EAAkB,WAAlB,gBAAAD,EAA2B,OAA3B,gBAAAD,EAAgC;AAElF,SACE,gBAAAG,EAAA,cAAC,OAAA,EAAI,WAAW,gBAAgBP,KAAa,EAAE,GAAA,GAC7C,gBAAAO,EAAA,cAAC,SAAA,EAAM,UAAQ,IAAC,SAAQ,QAAO,KAAKJ,GAAQ,CAC9C;AAEJ,GChBaK,KAAW,CAAAC,MAAS;AAC/B,QAA+BH,IAAAG,GAAvB,aAAAT,MAAuBM,GAATI,IAAAC,GAASL,GAAT,CAAd;AACR,SACE,gBAAAC,EAAA,cAAC,OAAAK,GAAAC,EAAA,EAAI,WAAAb,KAA0BU,IAA9B,EAAoC,SAAQ,YAAA,IAC3C,gBAAAH,EAAA,cAAC,QAAA,EAAK,GAAE,qOAAA,CAAqO,CAC/O;AAEJ,GCDaO,KAGR,CAAC,EAAE,OAAAf,GAAO,WAAAC,QAAgB;;AAC7B,QAAM,EAAE,YAAAe,GAAY,WAAAd,EAAA,I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C;AAArC,MAAAD,IAAAC,GAAE,SAAA+F,IAAQ,GAAG,SAAA2B,MAAb3H,GAAyBI,IAAAE,GAAzBN,GAAyB,CAAvB,SAAW;;AACjB,QAAM,EAAE,WAAAJ,EAAA,IAAcC,GAAA,GAChBgG,IAAK8B,KAAW,OAAO,KAAK/H,EAAU,KAAK,EAAE,CAAC,GAC9CF,KAAQO,IAAAL,EAAU,MAAMiG,CAAE,MAAlB,gBAAA5F,EAAqB;AAEnC,SAAKP,IAOH,gBAAAQ,EAAA,cAACqG,IAAA/F,EAAA,EAAM,KAAKqF,GAAI,OAAAG,GAAc,OAAAtG,KAAkBU,KAC7CJ,IAAAN,KAAA,gBAAAA,EAAO,YAAP,gBAAAM,EAAgB,IAAI,CAAA0O,sCAClBvI,IAAA3F,EAAA,EAAoB,KAAKkO,GAAgB,SAASA,GAAgB,OAAO1I,IAAQ,KAAO5F,EAAO,EAEpG,KAVI,QAAQ,IAAI,aAAa,gBAAc,QAAQ,KAAK,iBAAiBuH,CAAO,GAEzE;AAUX;AAEA,SAAS6G,KAAsB;AAC7B,QAAMG,IAAQ,OAAO;AAErB,SAAIA,IAAQ,MAAY,IACfA,IAAQ,MAAY,KACpBA,IAAQ,OAAa,KACrBA,IAAQ,OAAa,KACrBA,IAAQ,OAAa,KAClB;AACd;","x_google_ignoreList":[4]}
1
+ {"version":3,"file":"index.js","sources":["../src/components/audio.tsx","../src/icons/file-icon.tsx","../src/components/file.tsx","../src/components/google-drive.tsx","../../../node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js","../src/components/page-aside.tsx","../src/components/sync-pointer-block.tsx","../src/icons/link-icon.tsx","../src/block.tsx","../src/renderer.tsx"],"sourcesContent":["import React from 'react'\n\nimport { AudioBlock } from '@texonom/ntypes'\n\nimport { useNotionContext } from '../context'\n\nexport const Audio: React.FC<{\n block: AudioBlock\n className?: string\n}> = ({ block, className }) => {\n const { recordMap } = useNotionContext()\n const source = recordMap.signed_urls[block.id] || block.properties?.source?.[0]?.[0]\n\n return (\n <div className={`notion-audio ${className || ''}`}>\n <audio controls preload='none' src={source} />\n </div>\n )\n}\n","import React from 'react'\n\nexport const FileIcon = props => {\n const { className, ...rest } = props\n return (\n <svg className={className} {...rest} viewBox='0 0 30 30'>\n <path d='M22,8v12c0,3.866-3.134,7-7,7s-7-3.134-7-7V8c0-2.762,2.238-5,5-5s5,2.238,5,5v12c0,1.657-1.343,3-3,3s-3-1.343-3-3V8h-2v12c0,2.762,2.238,5,5,5s5-2.238,5-5V8c0-3.866-3.134-7-7-7S6,4.134,6,8v12c0,4.971,4.029,9,9,9s9-4.029,9-9V8H22z'></path>\n </svg>\n )\n}\n","import React from 'react'\n\nimport { FileBlock } from '@texonom/ntypes'\n\nimport { useNotionContext } from '../context'\nimport { FileIcon } from '../icons/file-icon'\nimport { Text } from './text'\n\nexport const File: React.FC<{\n block: FileBlock\n className?: string\n}> = ({ block, className }) => {\n const { components, recordMap } = useNotionContext()\n const source = recordMap.signed_urls[block.id] || block.properties?.source?.[0]?.[0]\n\n return (\n <div className={`notion-file ${className || ''}`}>\n <components.Link className='notion-file-link' href={source} target='_blank' rel='noopener noreferrer'>\n <FileIcon className='notion-file-icon' />\n\n <div className='notion-file-info'>\n <div className='notion-file-title'>\n <Text value={block.properties?.title || [['File']]} block={block} />\n </div>\n\n {block.properties?.size && (\n <div className='notion-file-size'>\n <Text value={block.properties.size} block={block} />\n </div>\n )}\n </div>\n </components.Link>\n </div>\n )\n}\n","import React from 'react'\n\nimport { GoogleDriveBlock } from '@texonom/ntypes'\n\nimport { useNotionContext } from '../context'\nimport { GracefulImage } from './graceful-image'\n\nexport const GoogleDrive: React.FC<{\n block: GoogleDriveBlock\n className?: string\n}> = ({ block, className }) => {\n const { components, mapImageUrl } = useNotionContext()\n const properties = block.format?.drive_properties\n if (!properties) return null\n let domain\n\n try {\n const url = new URL(properties.url)\n domain = url.hostname\n } catch (err) {\n // ignore invalid urls for robustness\n }\n\n return (\n <div className={`notion-google-drive ${className || ''}`}>\n <components.Link className='notion-google-drive-link' href={properties.url} target='_blank' rel='noopener noreferrer'>\n <div className='notion-google-drive-preview'>\n <GracefulImage\n src={mapImageUrl(properties.thumbnail, block)}\n alt={properties.title || 'Google Drive Document'}\n loading='lazy'\n />\n </div>\n\n <div className='notion-google-drive-body'>\n {properties.title && <div className='notion-google-drive-body-title'>{properties.title}</div>}\n\n {/* TODO: re-add last modified time with alternative to timeago.js */}\n {/* {properties.modified_time && (\n <div className='notion-google-drive-body-modified-time'>\n Last modified{' '}\n {properties.user_name ? `by ${properties.user_name} ` : ''}\n {timeago(properties.modified_time)}\n </div>\n )} */}\n\n {properties.icon && domain && (\n <div className='notion-google-drive-body-source'>\n {properties.icon && (\n <div\n className='notion-google-drive-body-source-icon'\n style={{\n backgroundImage: `url(${properties.icon})`\n }}\n />\n )}\n\n {domain && <div className='notion-google-drive-body-source-domain'>{domain}</div>}\n </div>\n )}\n </div>\n </components.Link>\n </div>\n )\n}\n","/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = throttle;\n","import React from 'react'\n\nimport throttle from 'lodash.throttle'\nimport { TableOfContentsEntry, uuidToId } from '@texonom/nutils'\n\nexport const PageAside: React.FC<{\n toc: Array<TableOfContentsEntry>\n activeSection: string | null\n setActiveSection: (activeSection: string | null) => unknown\n hasToc: boolean\n hasAside: boolean\n pageAside?: React.ReactNode\n className?: string\n}> = ({ toc, activeSection, setActiveSection, pageAside, hasToc, hasAside, className }) => {\n const throttleMs = 100\n const actionSectionScrollSpy = React.useMemo(\n () =>\n throttle(() => {\n const sections = document.getElementsByClassName('notion-h')\n\n let prevBBox: DOMRect = null\n let currentSectionId = activeSection\n\n for (let i = 0; i < sections.length; ++i) {\n const section = sections[i]\n if (!section || !(section instanceof Element)) continue\n\n if (!currentSectionId) currentSectionId = section.getAttribute('data-id')\n\n const bbox = section.getBoundingClientRect()\n const prevHeight = prevBBox ? bbox.top - prevBBox.bottom : 0\n const offset = Math.max(150, prevHeight / 4)\n\n // GetBoundingClientRect returns values relative to the viewport\n if (bbox.top - offset < 0) {\n currentSectionId = section.getAttribute('data-id')\n\n prevBBox = bbox\n continue\n }\n\n // No need to continue loop, if last element has been detected\n break\n }\n\n setActiveSection(currentSectionId)\n }, throttleMs),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n // explicitly not taking a dependency on activeSection\n setActiveSection\n ]\n )\n\n React.useEffect(() => {\n if (!hasToc) return\n\n window.addEventListener('scroll', actionSectionScrollSpy)\n\n actionSectionScrollSpy()\n\n return () => {\n window.removeEventListener('scroll', actionSectionScrollSpy)\n }\n }, [hasToc, actionSectionScrollSpy])\n\n if (!hasAside) return null\n\n return (\n <aside className={`notion-aside ${className || ''}`}>\n {hasToc && (\n <div className='notion-aside-table-of-contents'>\n <div className='notion-aside-table-of-contents-header'>Table of Contents</div>\n\n <nav className='notion-table-of-contents'>\n {toc.map(tocItem => {\n const id = uuidToId(tocItem.id)\n\n return (\n <a\n key={id}\n href={`#${id}`}\n className={`notion-table-of-contents-item\n notion-table-of-contents-item-indent-level-${tocItem.indentLevel}\n ${activeSection === id && 'notion-table-of-contents-active-item'}`}>\n <span\n className='notion-table-of-contents-item-body'\n style={{\n display: 'inline-block',\n marginLeft: tocItem.indentLevel * 16\n }}>\n {tocItem.text}\n </span>\n </a>\n )\n })}\n </nav>\n </div>\n )}\n\n {pageAside}\n </aside>\n )\n}\n","import React from 'react'\n\nimport { NotionBlockRenderer } from '../renderer'\n\nimport type { Block as BlockType, SyncPointerBlock as SyncPointerBlockType } from '@texonom/ntypes'\n\nexport const SyncPointerBlock: React.FC<{\n block: BlockType\n level: number\n}> = ({ block, level }) => {\n if (!block) {\n if (process.env.NODE_ENV !== 'production') console.warn('missing sync pointer block', block.id)\n\n return null\n }\n\n const syncPointerBlock = block as SyncPointerBlockType\n const referencePointerId = syncPointerBlock?.format?.transclusion_reference_pointer?.id\n\n if (!referencePointerId) return null\n\n return <NotionBlockRenderer key={referencePointerId} level={level} blockId={referencePointerId} />\n}\n","import React from 'react'\n\nexport const LinkIcon = props => {\n const { className, ...rest } = props\n return (\n <svg className={className} {...rest} viewBox='0 0 16 16' width='16' height='16'>\n <path\n fillRule='evenodd'\n d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'\n />\n </svg>\n )\n}\n","import React from 'react'\n\nimport {\n getBlockCollectionId,\n getBlockIcon,\n getBlockParentPage,\n getPageTableOfContents,\n getTextContent,\n uuidToId\n} from '@texonom/nutils'\n\nimport { AssetWrapper } from './components/asset-wrapper'\nimport { Audio } from './components/audio'\nimport { EOI } from './components/eoi'\nimport { File } from './components/file'\nimport { GoogleDrive } from './components/google-drive'\nimport { LazyImage } from './components/lazy-image'\nimport { PageAside } from './components/page-aside'\nimport { PageIcon } from './components/page-icon'\nimport { PageTitle } from './components/page-title'\nimport { SyncPointerBlock } from './components/sync-pointer-block'\nimport { Text } from './components/text'\nimport { useNotionContext } from './context'\nimport { LinkIcon } from './icons/link-icon'\nimport { getListNumber, isUrl } from './utils'\n\nimport type {\n Block as BlockType,\n PageBlock,\n GoogleDriveBlock,\n AudioBlock,\n FileBlock,\n EquationBlock,\n CollectionViewPageBlock,\n CodeBlock,\n TableBlock\n} from '@texonom/ntypes'\ninterface BlockProps {\n block: BlockType\n level: number\n\n className?: string\n bodyClassName?: string\n\n header?: React.ReactNode\n footer?: React.ReactNode\n pageHeader?: React.ReactNode\n pageFooter?: React.ReactNode\n pageTitle?: React.ReactNode\n pageAside?: React.ReactNode\n pageCover?: React.ReactNode\n\n hideBlockId?: boolean\n disableHeader?: boolean\n\n children?: React.ReactNode\n}\n\n// TODO: use react state instead of a global for this\nconst tocIndentLevelCache: {\n [blockId: string]: number\n} = {}\n\nconst pageCoverStyleCache: Record<string, object> = {}\n\nexport const Block: React.FC<BlockProps> = props => {\n const ctx = useNotionContext()\n const {\n components,\n fullPage,\n recordMap,\n mapPageUrl,\n mapImageUrl,\n showTableOfContents,\n minTableOfContentsItems,\n defaultPageIcon,\n defaultPageCover,\n defaultPageCoverPosition\n } = ctx\n\n const [activeSection, setActiveSection] = React.useState(null)\n\n const {\n block,\n children,\n level,\n className,\n bodyClassName,\n header,\n footer,\n pageHeader,\n pageFooter,\n pageTitle,\n pageAside,\n pageCover,\n hideBlockId,\n disableHeader\n } = props\n\n if (!block) return null\n\n // ugly hack to make viewing raw collection views work properly\n // e.g., 6d886ca87ab94c21a16e3b82b43a57fb\n if (level === 0 && block.type === 'collection_view') {\n const view_block = block as unknown as CollectionViewPageBlock\n view_block.type = 'collection_view_page'\n }\n\n const blockId = hideBlockId ? 'notion-block' : `notion-block-${uuidToId(block.id)}`\n\n switch (block.type) {\n case 'collection_view_page':\n // fallthrough\n case 'page':\n if (level === 0) {\n const {\n page_icon = defaultPageIcon,\n page_cover = defaultPageCover,\n page_cover_position = defaultPageCoverPosition,\n page_full_width,\n page_small_text\n } = block.format || {}\n\n if (fullPage) {\n const properties =\n block.type === 'page'\n ? block.properties\n : {\n title: recordMap.collection[getBlockCollectionId(block, recordMap)]?.value?.name\n }\n\n const coverPosition = (1 - (page_cover_position || 0.5)) * 100\n const pageCoverObjectPosition = `center ${coverPosition}%`\n let pageCoverStyle = pageCoverStyleCache[pageCoverObjectPosition]\n if (!pageCoverStyle)\n pageCoverStyle = pageCoverStyleCache[pageCoverObjectPosition] = {\n objectPosition: pageCoverObjectPosition\n }\n\n const pageIcon = getBlockIcon(block, recordMap) ?? defaultPageIcon\n const isPageIconUrl = pageIcon && isUrl(pageIcon)\n\n const toc = getPageTableOfContents(block as PageBlock, recordMap)\n\n const hasToc = showTableOfContents && toc.length >= minTableOfContentsItems\n const hasAside = (hasToc || pageAside) && !page_full_width\n const hasPageCover = pageCover || page_cover\n\n return (\n <div className={`notion notion-app ${blockId} ${className || ''}`}>\n <div className='notion-viewport' />\n\n <div className='notion-frame'>\n {!disableHeader && <components.Header block={block} />}\n {header}\n\n <div className='notion-page-scroller'>\n {hasPageCover &&\n (pageCover ? (\n pageCover\n ) : (\n <div className='notion-page-cover-wrapper'>\n <LazyImage\n src={mapImageUrl(page_cover, block)}\n alt={getTextContent(properties?.title)}\n priority={true}\n className='notion-page-cover'\n style={pageCoverStyle}\n />\n </div>\n ))}\n\n <main\n className={`notion-page\n ${hasPageCover ? 'notion-page-has-cover' : 'notion-page-no-cover'}\n ${page_icon ? 'notion-page-has-icon' : 'notion-page-no-icon'}\n ${isPageIconUrl ? 'notion-page-has-image-icon' : 'notion-page-has-text-icon'}\n notion-full-page\n ${page_full_width && 'notion-full-width'}\n ${page_small_text && 'notion-small-text'}\n ${bodyClassName}`}>\n {page_icon && <PageIcon block={block} defaultIcon={defaultPageIcon} inline={false} />}\n\n {pageHeader}\n\n <h1 className='notion-title'>{pageTitle ?? <Text value={properties?.title} block={block} />}</h1>\n\n {(block.type === 'collection_view_page' ||\n (block.type === 'page' && block.parent_table === 'collection')) && (\n <components.Collection block={block} ctx={ctx} />\n )}\n\n {block.type !== 'collection_view_page' && (\n <div\n className={`notion-page-content\n ${hasAside && 'notion-page-content-has-aside'}\n ${hasToc && 'notion-page-content-has-toc'}`}>\n <article className='notion-page-content-inner'>{children}</article>\n\n {hasAside && (\n <PageAside\n toc={toc}\n activeSection={activeSection}\n setActiveSection={setActiveSection}\n hasToc={hasToc}\n hasAside={hasAside}\n pageAside={pageAside}\n />\n )}\n </div>\n )}\n\n {pageFooter}\n </main>\n\n {footer}\n </div>\n </div>\n </div>\n )\n } else {\n return (\n <main\n className={`notion\n notion-page\n ${page_full_width && 'notion-full-width'}\n ${page_small_text && 'notion-small-text'}\n ${blockId}\n ${className || ''}\n ${bodyClassName}`}>\n <div className='notion-viewport' />\n\n {pageHeader}\n\n {(block.type === 'collection_view_page' || (block.type === 'page' && block.parent_table === 'collection')) && (\n <components.Collection block={block} ctx={ctx} />\n )}\n\n {block.type !== 'collection_view_page' && children}\n\n {pageFooter}\n </main>\n )\n }\n } else {\n const blockColor = block.format?.block_color\n\n return (\n <components.PageLink\n className={`notion-page-link ${blockColor && `notion-${blockColor}`} ${blockId}`}\n href={mapPageUrl(block.id)}>\n <PageTitle block={block} />\n </components.PageLink>\n )\n }\n\n case 'header':\n // fallthrough\n case 'sub_header':\n // fallthrough\n case 'sub_sub_header': {\n if (!block.properties) return null\n\n const blockColor = block.format?.block_color\n const id = uuidToId(block.id)\n const title = getTextContent(block.properties.title) || `Notion Header ${id}`\n\n // we use a cache here because constructing the ToC is non-trivial\n let indentLevel = tocIndentLevelCache[block.id]\n let indentLevelClass: string\n\n if (indentLevel === undefined) {\n const page = getBlockParentPage(block, recordMap)\n\n if (page) {\n const toc = getPageTableOfContents(page, recordMap)\n const tocItem = toc.find(tocItem => tocItem.id === block.id)\n\n if (tocItem) {\n indentLevel = tocItem.indentLevel\n tocIndentLevelCache[block.id] = indentLevel\n }\n }\n }\n\n if (indentLevel !== undefined) indentLevelClass = `notion-h-indent-${indentLevel}`\n\n const isH1 = block.type === 'header'\n const isH2 = block.type === 'sub_header'\n const isH3 = block.type === 'sub_sub_header'\n\n const classNameStr = `${isH1 && 'notion-h notion-h1'}\n ${isH2 && 'notion-h notion-h2'}\n ${isH3 && 'notion-h notion-h3'}\n ${blockColor && `notion-${blockColor}`}\n ${indentLevelClass},\n ${blockId}`\n\n const innerHeader = (\n <span>\n <div id={id} className='notion-header-anchor' />\n {!block.format?.toggleable && (\n <a className='notion-hash-link' href={`#${id}`} title={title}>\n <LinkIcon />\n </a>\n )}\n\n <span className='notion-h-title'>\n <Text value={block.properties.title} block={block} />\n </span>\n </span>\n )\n let headerBlock = null\n\n //page title takes the h1 so all header blocks are greater\n if (isH1)\n headerBlock = (\n <h2 className={classNameStr} data-id={id}>\n {innerHeader}\n </h2>\n )\n else if (isH2)\n headerBlock = (\n <h3 className={classNameStr} data-id={id}>\n {innerHeader}\n </h3>\n )\n else\n headerBlock = (\n <h4 className={classNameStr} data-id={id}>\n {innerHeader}\n </h4>\n )\n\n if (block.format?.toggleable)\n return (\n <details className={`notion-toggle ${blockId}`}>\n <summary>{headerBlock}</summary>\n <div>{children}</div>\n </details>\n )\n else return headerBlock\n }\n\n case 'divider':\n return <hr className={`notion-hr ${blockId}`} />\n\n case 'text': {\n if (!block.properties && !block.content?.length) return <div className={`notion-blank ${blockId}`}>&nbsp;</div>\n\n const blockColor = block.format?.block_color\n\n return (\n <div className={`notion-text ${blockColor && `notion-${blockColor}`} ${blockId}`}>\n {block.properties?.title && <Text value={block.properties.title} block={block} />}\n\n {children && <div className='notion-text-children'>{children}</div>}\n </div>\n )\n }\n\n case 'bulleted_list':\n // fallthrough\n case 'numbered_list': {\n const wrapList = (content: React.ReactNode, start?: number) =>\n block.type === 'bulleted_list' ? (\n <ul className={`notion-list notion-list-disc ${blockId}`}>{content}</ul>\n ) : (\n <ol start={start} className={`notion-list notion-list-numbered ${blockId}`}>\n {content}\n </ol>\n )\n\n let output: React.JSX.Element | null = null\n\n if (block.content)\n output = (\n <>\n {block.properties && (\n <li>\n <Text value={block.properties.title} block={block} />\n </li>\n )}\n {wrapList(children)}\n </>\n )\n else\n output = block.properties ? (\n <li>\n <Text value={block.properties.title} block={block} />\n </li>\n ) : null\n\n const isTopLevel = block.type !== recordMap.block[block.parent_id]?.value?.type\n const start = getListNumber(block.id, recordMap.block)\n\n return isTopLevel ? wrapList(output, start) : output\n }\n\n case 'embed':\n return <components.Embed blockId={blockId} block={block} />\n case 'tweet':\n // fallthrough\n case 'maps':\n // fallthrough\n case 'pdf':\n // fallthrough\n case 'figma':\n // fallthrough\n case 'typeform':\n // fallthrough\n case 'codepen':\n // fallthrough\n case 'excalidraw':\n // fallthrough\n case 'image':\n // fallthrough\n case 'gist':\n // fallthrough\n case 'video':\n return <AssetWrapper blockId={blockId} block={block} />\n\n case 'drive': {\n const properties = block.format?.drive_properties\n if (!properties)\n if (block.format?.display_source)\n //check if this drive actually needs to be embeded ex. google sheets.\n return <AssetWrapper blockId={blockId} block={block} />\n\n return <GoogleDrive block={block as GoogleDriveBlock} className={blockId} />\n }\n\n case 'audio':\n return <Audio block={block as AudioBlock} className={blockId} />\n\n case 'file':\n return <File block={block as FileBlock} className={blockId} />\n\n case 'equation':\n return <components.Equation block={block as EquationBlock} inline={false} className={blockId} />\n\n case 'code':\n return <components.Code block={block as CodeBlock} />\n\n case 'column_list':\n return <div className={`notion-row ${blockId}`}>{children}</div>\n\n case 'column': {\n // note: notion uses 46px\n const spacerWidth = `min(32px, 4vw)`\n const ratio = block.format?.column_ratio || 0.5\n const parent = recordMap.block[block.parent_id]?.value\n const columns = parent?.content?.length || Math.max(2, Math.ceil(1.0 / ratio))\n\n const width = `calc((100% - (${columns - 1} * ${spacerWidth})) * ${ratio})`\n const style = { width }\n\n return (\n <>\n <div className={`notion-column ${blockId}`} style={style}>\n {children}\n </div>\n\n <div className='notion-spacer' />\n </>\n )\n }\n\n case 'quote': {\n if (!block.properties) return null\n\n const blockColor = block.format?.block_color\n\n return (\n <blockquote className={`notion-quote ${blockColor && `notion-${blockColor}`} ${blockId}`}>\n <div>\n <Text value={block.properties.title} block={block} />\n </div>\n {children}\n </blockquote>\n )\n }\n\n case 'collection_view':\n return <components.Collection block={block} className={blockId} ctx={ctx} />\n\n case 'callout':\n if (components.Callout) return <components.Callout block={block} className={blockId} />\n else\n return (\n <div\n className={`notion-callout ${block.format?.block_color && `notion-${block.format?.block_color}_co`} ${blockId}`}>\n <PageIcon block={block} />\n\n <div className='notion-callout-text'>\n <Text value={block.properties?.title} block={block} />\n {children}\n </div>\n </div>\n )\n\n case 'bookmark': {\n if (!block.properties) return null\n\n const link = block.properties.link\n if (!link || !link[0]?.[0]) return null\n\n let title = getTextContent(block.properties.title)\n if (!title) title = getTextContent(link)\n\n if (title)\n if (title.startsWith('http'))\n try {\n const url = new URL(title)\n title = url.hostname\n } catch (err) {\n // ignore invalid links\n }\n\n return (\n <components.Link\n target='_blank'\n rel='noopener noreferrer'\n className={`notion-bookmark ${block.format?.block_color && `notion-${block.format.block_color}`} ${blockId}`}\n href={link[0][0]}>\n <div>\n {title && (\n <div className='notion-bookmark-title'>\n <Text value={[[title]]} block={block} />\n </div>\n )}\n\n {block.properties?.description && (\n <div className='notion-bookmark-description'>\n <Text value={block.properties?.description} block={block} />\n </div>\n )}\n\n <div className='notion-bookmark-link'>\n {block.format?.bookmark_icon && (\n <div className='notion-bookmark-link-icon'>\n <LazyImage\n src={mapImageUrl(block.format?.bookmark_icon, block)}\n alt={title}\n onError={e => {\n const parent = e.currentTarget.closest('.notion-bookmark-link-icon') as HTMLElement\n if (parent) parent.style.display = 'none'\n }}\n />\n </div>\n )}\n\n <div className='notion-bookmark-link-text'>\n <Text value={link} block={block} />\n </div>\n </div>\n </div>\n\n {block.format?.bookmark_cover && (\n <div className='notion-bookmark-image'>\n <LazyImage\n src={mapImageUrl(block.format?.bookmark_cover, block)}\n alt={getTextContent(block.properties?.title)}\n style={{\n objectFit: 'cover'\n }}\n onError={e => {\n const parent = e.currentTarget.closest('.notion-bookmark-image') as HTMLElement\n if (parent) parent.style.display = 'none'\n }}\n />\n </div>\n )}\n </components.Link>\n )\n }\n\n case 'toggle':\n return (\n <details className={`notion-toggle ${blockId}`}>\n <summary>\n <Text value={block.properties?.title} block={block} />\n </summary>\n\n <div>{children}</div>\n </details>\n )\n\n case 'table_of_contents': {\n const page = getBlockParentPage(block, recordMap)\n if (!page) return null\n\n const toc = getPageTableOfContents(page, recordMap)\n const blockColor = block.format?.block_color\n\n return (\n <div className={`notion-table-of-contents ${blockColor && `notion-${blockColor}`} ${blockId}`}>\n {toc.map(tocItem => (\n <a key={tocItem.id} href={`#${uuidToId(tocItem.id)}`} className='notion-table-of-contents-item'>\n <span\n className='notion-table-of-contents-item-body'\n style={{\n display: 'inline-block',\n marginLeft: tocItem.indentLevel * 24\n }}>\n {tocItem.text}\n </span>\n </a>\n ))}\n </div>\n )\n }\n\n case 'to_do': {\n const isChecked = block.properties?.checked?.[0]?.[0] === 'Yes'\n\n return (\n <div className={`notion-to-do ${blockId}`}>\n <div className='notion-to-do-item'>\n <components.Checkbox blockId={blockId} isChecked={isChecked} />\n\n <div className={`notion-to-do-body ${isChecked && `notion-to-do-checked`}`}>\n <Text value={block.properties?.title} block={block} />\n </div>\n </div>\n\n <div className='notion-to-do-children'>{children}</div>\n </div>\n )\n }\n\n case 'transclusion_container':\n return <div className={`notion-sync-block ${blockId}`}>{children}</div>\n\n case 'transclusion_reference':\n return <SyncPointerBlock block={block} level={level + 1} {...props} />\n\n case 'alias': {\n const blockPointerId = block?.format?.alias_pointer?.id\n const linkedBlock = recordMap.block[blockPointerId]?.value\n if (!linkedBlock) {\n console.debug('\"alias\" missing block', blockPointerId)\n return null\n }\n\n return (\n <components.PageLink className={`notion-page-link ${blockPointerId}}`} href={mapPageUrl(blockPointerId)}>\n <PageTitle block={linkedBlock} />\n </components.PageLink>\n )\n }\n\n case 'table':\n return (\n <table className={`notion-simple-table ${blockId}`}>\n <tbody>{children}</tbody>\n </table>\n )\n\n case 'table_row': {\n const tableBlock = recordMap.block[block.parent_id]?.value as TableBlock\n const order = tableBlock.format?.table_block_column_order\n const formatMap = tableBlock.format?.table_block_column_format\n const backgroundColor = block.format?.block_color\n\n if (!tableBlock || !order) return null\n\n return (\n <tr className={`notion-simple-table-row ${backgroundColor && `notion-${backgroundColor}`} ${blockId}`}>\n {order.map(column => {\n const color = formatMap?.[column]?.color\n\n return (\n <td\n key={column}\n className={color ? `notion-${color}` : ''}\n style={{\n width: formatMap?.[column]?.width || 120\n }}>\n <div className='notion-simple-table-cell'>\n <Text value={block.properties?.[column] || [['ㅤ']]} block={block} />\n </div>\n </td>\n )\n })}\n </tr>\n )\n }\n\n case 'external_object_instance':\n return <EOI block={block} className={blockId} />\n\n default:\n if (process.env.NODE_ENV !== 'production')\n console.debug('Unsupported type ' + (block as BlockType).type, JSON.stringify(block, null, 2))\n\n return <div />\n }\n}\n","import React from 'react'\n\nimport mediumZoom from '@fisch0920/medium-zoom'\nimport type { ExtendedRecordMap } from '@texonom/ntypes'\n\nimport { Block } from './block'\nimport { NotionContextProvider, useNotionContext } from './context'\nimport { MapImageUrlFn, MapPageUrlFn, NotionComponents, SearchNotionFn } from './types'\n\nexport const NotionRenderer: React.FC<{\n recordMap: ExtendedRecordMap\n components?: Partial<NotionComponents>\n\n mapPageUrl?: MapPageUrlFn\n mapImageUrl?: MapImageUrlFn\n searchNotion?: SearchNotionFn\n isShowingSearch?: boolean\n onHideSearch?: () => void\n\n rootPageId?: string\n rootDomain?: string\n rootSpaceId?: string\n\n // set fullPage to false to render page content only\n // this will remove the header, cover image, and footer\n fullPage?: boolean\n\n darkMode?: boolean\n previewImages?: boolean\n forceCustomImages?: boolean\n showCollectionViewDropdown?: boolean\n linkTableTitleProperties?: boolean\n isLinkCollectionToUrlProperty?: boolean\n isImageZoomable?: boolean\n\n showTableOfContents?: boolean\n minTableOfContentsItems?: number\n\n defaultPageIcon?: string\n defaultPageCover?: string\n defaultPageCoverPosition?: number\n\n className?: string\n bodyClassName?: string\n\n header?: React.ReactNode\n footer?: React.ReactNode\n pageHeader?: React.ReactNode\n pageFooter?: React.ReactNode\n pageTitle?: React.ReactNode\n pageAside?: React.ReactNode\n pageCover?: React.ReactNode\n\n blockId?: string\n hideBlockId?: boolean\n disableHeader?: boolean\n}> = ({\n components,\n recordMap,\n mapPageUrl,\n mapImageUrl,\n searchNotion,\n isShowingSearch,\n onHideSearch,\n fullPage,\n rootPageId,\n rootDomain,\n rootSpaceId,\n darkMode,\n previewImages,\n forceCustomImages,\n showCollectionViewDropdown,\n linkTableTitleProperties,\n isLinkCollectionToUrlProperty,\n isImageZoomable = true,\n showTableOfContents,\n minTableOfContentsItems,\n defaultPageIcon,\n defaultPageCover,\n defaultPageCoverPosition,\n ...rest\n}) => {\n const zoom = React.useMemo(\n () =>\n typeof window !== 'undefined' &&\n mediumZoom({\n background: 'rgba(0, 0, 0, 0.8)',\n minZoomScale: 2.0,\n margin: getMediumZoomMargin()\n }),\n []\n )\n\n return (\n <NotionContextProvider\n components={components}\n recordMap={recordMap}\n mapPageUrl={mapPageUrl}\n mapImageUrl={mapImageUrl}\n searchNotion={searchNotion}\n isShowingSearch={isShowingSearch}\n onHideSearch={onHideSearch}\n fullPage={fullPage}\n rootPageId={rootPageId}\n rootDomain={rootDomain}\n rootSpaceId={rootSpaceId}\n darkMode={darkMode}\n previewImages={previewImages}\n forceCustomImages={forceCustomImages}\n showCollectionViewDropdown={showCollectionViewDropdown}\n linkTableTitleProperties={linkTableTitleProperties}\n isLinkCollectionToUrlProperty={isLinkCollectionToUrlProperty}\n showTableOfContents={showTableOfContents}\n minTableOfContentsItems={minTableOfContentsItems}\n defaultPageIcon={defaultPageIcon}\n defaultPageCover={defaultPageCover}\n defaultPageCoverPosition={defaultPageCoverPosition}\n zoom={isImageZoomable ? zoom : null}>\n <NotionBlockRenderer {...rest} />\n </NotionContextProvider>\n )\n}\n\nexport const NotionBlockRenderer: React.FC<{\n className?: string\n bodyClassName?: string\n header?: React.ReactNode\n footer?: React.ReactNode\n disableHeader?: boolean\n\n blockId?: string\n hideBlockId?: boolean\n level?: number\n}> = ({ level = 0, blockId, ...props }) => {\n const { recordMap } = useNotionContext()\n const id = blockId || Object.keys(recordMap.block)[0]\n const block = recordMap.block[id]?.value\n\n if (!block) {\n if (process.env.NODE_ENV !== 'production') console.warn('missing block', blockId)\n\n return null\n }\n\n return (\n <Block key={id} level={level} block={block} {...props}>\n {block?.content?.map(contentBlockId => (\n <NotionBlockRenderer key={contentBlockId} blockId={contentBlockId} level={level + 1} {...props} />\n ))}\n </Block>\n )\n}\n\nfunction getMediumZoomMargin() {\n const width = window.innerWidth\n\n if (width < 500) return 8\n else if (width < 800) return 20\n else if (width < 1280) return 30\n else if (width < 1600) return 40\n else if (width < 1920) return 48\n else return 72\n}\n"],"names":["Audio","block","className","recordMap","useNotionContext","source","_c","_b","_a","React","FileIcon","props","rest","__objRest","__spreadProps","__spreadValues","File","components","Text","_d","_e","GoogleDrive","mapImageUrl","properties","domain","err","GracefulImage","FUNC_ERROR_TEXT","NAN","symbolTag","reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","freeGlobal","global","freeSelf","root","objectProto","objectToString","nativeMax","nativeMin","now","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","toNumber","isObject","invokeFunc","time","args","thisArg","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","shouldInvoke","trailingEdge","cancel","flush","debounced","isInvoking","throttle","value","type","isObjectLike","isSymbol","other","isBinary","lodash_throttle","PageAside","toc","activeSection","setActiveSection","pageAside","hasToc","hasAside","actionSectionScrollSpy","sections","prevBBox","currentSectionId","i","section","bbox","prevHeight","offset","tocItem","id","uuidToId","SyncPointerBlock","level","syncPointerBlock","referencePointerId","NotionBlockRenderer","LinkIcon","tocIndentLevelCache","pageCoverStyleCache","Block","ctx","fullPage","mapPageUrl","showTableOfContents","minTableOfContentsItems","defaultPageIcon","defaultPageCover","defaultPageCoverPosition","children","bodyClassName","header","footer","pageHeader","pageFooter","pageTitle","pageCover","hideBlockId","disableHeader","view_block","blockId","page_icon","page_cover","page_cover_position","page_full_width","page_small_text","getBlockCollectionId","pageCoverObjectPosition","pageCoverStyle","pageIcon","getBlockIcon","isPageIconUrl","isUrl","getPageTableOfContents","hasPageCover","LazyImage","getTextContent","PageIcon","blockColor","PageTitle","title","indentLevel","indentLevelClass","page","getBlockParentPage","isH1","isH2","isH3","classNameStr","innerHeader","_f","headerBlock","_g","_h","_i","_j","wrapList","content","start","output","isTopLevel","_l","_k","getListNumber","AssetWrapper","_m","_n","spacerWidth","ratio","_o","parent","_p","style","_q","_r","_s","_t","_u","link","_v","_w","_x","_y","_z","_A","e","_B","_C","_D","_E","_F","isChecked","_I","_H","_G","_J","blockPointerId","_L","_K","linkedBlock","_M","tableBlock","_N","order","_O","formatMap","_P","backgroundColor","_Q","column","color","EOI","NotionRenderer","searchNotion","isShowingSearch","onHideSearch","rootPageId","rootDomain","rootSpaceId","darkMode","previewImages","forceCustomImages","showCollectionViewDropdown","linkTableTitleProperties","isLinkCollectionToUrlProperty","isImageZoomable","zoom","mediumZoom","getMediumZoomMargin","NotionContextProvider","contentBlockId","width"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMO,MAAMA,KAGR,CAAC,EAAE,OAAAC,GAAO,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