Commit e4df4349 authored by Eduardo Sanz García's avatar Eduardo Sanz García Committed by Eduardo

Avoid import aliases

Made some very minor changes to avoid import aliases.
parent e1408b36
...@@ -2,7 +2,7 @@ import classnames from 'classnames'; ...@@ -2,7 +2,7 @@ import classnames from 'classnames';
import { useEffect, useMemo, useRef } from 'preact/hooks'; import { useEffect, useMemo, useRef } from 'preact/hooks';
import { replaceLinksWithEmbeds } from '../media-embedder'; import { replaceLinksWithEmbeds } from '../media-embedder';
import { renderMathAndMarkdown as renderMarkdown } from '../render-markdown'; import { renderMathAndMarkdown } from '../render-markdown';
/** /**
* @typedef MarkdownViewProps * @typedef MarkdownViewProps
...@@ -25,7 +25,7 @@ export default function MarkdownView({ ...@@ -25,7 +25,7 @@ export default function MarkdownView({
textStyle = {}, textStyle = {},
}) { }) {
const html = useMemo( const html = useMemo(
() => (markdown ? renderMarkdown(markdown) : ''), () => (markdown ? renderMathAndMarkdown(markdown) : ''),
[markdown] [markdown]
); );
const content = /** @type {{ current: HTMLDivElement }} */ (useRef()); const content = /** @type {{ current: HTMLDivElement }} */ (useRef());
......
import { getApiUrl } from './get-api-url'; import { getApiUrl } from './get-api-url';
import { hostPageConfig as hostConfig } from './host-config'; import { hostPageConfig } from './host-config';
import * as postMessageJsonRpc from '../util/postmessage-json-rpc'; import * as postMessageJsonRpc from '../util/postmessage-json-rpc';
/** /**
...@@ -89,10 +89,10 @@ function fetchConfigFromAncestorFrame(origin, window_ = window) { ...@@ -89,10 +89,10 @@ function fetchConfigFromAncestorFrame(origin, window_ = window) {
* @return {Promise<object>} - The merged settings. * @return {Promise<object>} - The merged settings.
*/ */
function fetchConfigLegacy(appConfig, window_ = window) { function fetchConfigLegacy(appConfig, window_ = window) {
const hostPageConfig = hostConfig(window_); const hostConfig = hostPageConfig(window_);
let embedderConfig; let embedderConfig;
const origin = /** @type string */ (hostPageConfig.requestConfigFromFrame); const origin = /** @type string */ (hostConfig.requestConfigFromFrame);
embedderConfig = fetchConfigFromAncestorFrame(origin, window_); embedderConfig = fetchConfigFromAncestorFrame(origin, window_);
return embedderConfig.then(embedderConfig => { return embedderConfig.then(embedderConfig => {
...@@ -190,13 +190,13 @@ async function fetchGroupsAsync(config, rpcCall) { ...@@ -190,13 +190,13 @@ async function fetchGroupsAsync(config, rpcCall) {
* @return {Promise<MergedConfig>} - The merged settings. * @return {Promise<MergedConfig>} - The merged settings.
*/ */
export async function fetchConfig(appConfig, window_ = window) { export async function fetchConfig(appConfig, window_ = window) {
const hostPageConfig = hostConfig(window); const hostConfig = hostPageConfig(window);
const requestConfigFromFrame = hostPageConfig.requestConfigFromFrame; const requestConfigFromFrame = hostConfig.requestConfigFromFrame;
if (!requestConfigFromFrame) { if (!requestConfigFromFrame) {
// Directly embed: just get the config. // Directly embed: just get the config.
return fetchConfigEmbed(appConfig, hostPageConfig); return fetchConfigEmbed(appConfig, hostConfig);
} }
if (typeof requestConfigFromFrame === 'string') { if (typeof requestConfigFromFrame === 'string') {
// Legacy: send RPC to all parents to find config. (deprecated) // Legacy: send RPC to all parents to find config. (deprecated)
...@@ -222,7 +222,7 @@ export async function fetchConfig(appConfig, window_ = window) { ...@@ -222,7 +222,7 @@ export async function fetchConfig(appConfig, window_ = window) {
// as this is needed in the Notebook. // as this is needed in the Notebook.
return { return {
...rpcMergedConfig, ...rpcMergedConfig,
...(hostPageConfig.group ? { group: hostPageConfig.group } : {}), ...(hostConfig.group ? { group: hostConfig.group } : {}),
}; };
} else { } else {
throw new Error( throw new Error(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment