@jupyterlab/rendermime
Advanced tools
Comparing version 4.0.0-alpha.20 to 4.0.0-alpha.21
@@ -1,4 +0,3 @@ | ||
import { ISanitizer, ISessionContext } from '@jupyterlab/apputils'; | ||
import { IRenderMime } from '@jupyterlab/rendermime-interfaces'; | ||
import { Contents, Session } from '@jupyterlab/services'; | ||
import { Contents } from '@jupyterlab/services'; | ||
import { ITranslator } from '@jupyterlab/translation'; | ||
@@ -28,3 +27,3 @@ import { ReadonlyPartialJSONObject } from '@lumino/coreutils'; | ||
*/ | ||
readonly sanitizer: ISanitizer; | ||
readonly sanitizer: IRenderMime.ISanitizer; | ||
/** | ||
@@ -228,3 +227,2 @@ * The object used to resolve relative urls for the rendermime instance. | ||
private _path; | ||
private _session; | ||
private _contents; | ||
@@ -242,16 +240,4 @@ } | ||
*/ | ||
path?: string; | ||
path: string; | ||
/** | ||
* The session used by the resolver. | ||
* | ||
* @deprecated use the `path` option instead and update it as needed. | ||
* | ||
* #### Notes | ||
* For convenience, this can be a session context as well. Either session | ||
* or path must be given, and path takes precedence. | ||
* | ||
* TODO: remove this option and make `path` required. | ||
*/ | ||
session?: ISessionContext | Session.ISessionConnection; | ||
/** | ||
* The contents manager used by the resolver. | ||
@@ -258,0 +244,0 @@ */ |
@@ -233,11 +233,3 @@ /* ----------------------------------------------------------------------------- | ||
constructor(options) { | ||
if (options.path) { | ||
this._path = options.path; | ||
} | ||
else if (options.session) { | ||
this._session = options.session; | ||
} | ||
else { | ||
throw new Error("Either 'path' or 'session' must be given as a constructor option"); | ||
} | ||
this._path = options.path; | ||
this._contents = options.contents; | ||
@@ -249,4 +241,3 @@ } | ||
get path() { | ||
var _a; | ||
return (_a = this._path) !== null && _a !== void 0 ? _a : this._session.path; | ||
return this._path; | ||
} | ||
@@ -332,9 +323,3 @@ set path(value) { | ||
Private.sortedTypes = sortedTypes; | ||
function sessionConnection(s) { | ||
return s.sessionChanged | ||
? s.session | ||
: s; | ||
} | ||
Private.sessionConnection = sessionConnection; | ||
})(Private || (Private = {})); | ||
//# sourceMappingURL=registry.js.map |
@@ -1,2 +0,1 @@ | ||
import { ISanitizer } from '@jupyterlab/apputils'; | ||
import { IRenderMime } from '@jupyterlab/rendermime-interfaces'; | ||
@@ -35,3 +34,3 @@ import { ITranslator } from '@jupyterlab/translation'; | ||
*/ | ||
sanitizer: ISanitizer; | ||
sanitizer: IRenderMime.ISanitizer; | ||
/** | ||
@@ -170,3 +169,3 @@ * An optional url resolver. | ||
*/ | ||
sanitizer: ISanitizer; | ||
sanitizer: IRenderMime.ISanitizer; | ||
/** | ||
@@ -266,3 +265,3 @@ * An optional url resolver. | ||
*/ | ||
sanitizer: ISanitizer; | ||
sanitizer: IRenderMime.ISanitizer; | ||
/** | ||
@@ -269,0 +268,0 @@ * The source text to render. |
@@ -374,2 +374,3 @@ /* ----------------------------------------------------------------------------- | ||
export function renderText(options) { | ||
var _a, _b; | ||
// Unpack the options. | ||
@@ -388,3 +389,5 @@ const { host, sanitizer, source } = options; | ||
// Note: only text nodes and span elements should be present after sanitization in the `<pre>` element. | ||
const linkedNodes = autolink(preTextContent); | ||
const linkedNodes = ((_b = (_a = sanitizer.getAutolink) === null || _a === void 0 ? void 0 : _a.call(sanitizer)) !== null && _b !== void 0 ? _b : true) | ||
? autolink(preTextContent) | ||
: [document.createTextNode(content)]; | ||
let inAnchorElement = false; | ||
@@ -391,0 +394,0 @@ const combinedNodes = []; |
@@ -1,2 +0,1 @@ | ||
import { ISanitizer } from '@jupyterlab/apputils'; | ||
import { IRenderMime } from '@jupyterlab/rendermime-interfaces'; | ||
@@ -14,3 +13,3 @@ import { ITranslator } from '@jupyterlab/translation'; | ||
*/ | ||
readonly sanitizer: ISanitizer; | ||
readonly sanitizer: IRenderMime.ISanitizer; | ||
/** | ||
@@ -17,0 +16,0 @@ * The object used to resolve relative urls for the rendermime instance. |
{ | ||
"name": "@jupyterlab/rendermime", | ||
"version": "4.0.0-alpha.20", | ||
"version": "4.0.0-alpha.21", | ||
"description": "JupyterLab - RenderMime", | ||
@@ -45,17 +45,17 @@ "homepage": "https://github.com/jupyterlab/jupyterlab", | ||
"dependencies": { | ||
"@jupyterlab/apputils": "^4.0.0-alpha.20", | ||
"@jupyterlab/coreutils": "^6.0.0-alpha.20", | ||
"@jupyterlab/nbformat": "^4.0.0-alpha.20", | ||
"@jupyterlab/observables": "^5.0.0-alpha.20", | ||
"@jupyterlab/rendermime-interfaces": "^3.8.0-alpha.20", | ||
"@jupyterlab/services": "^7.0.0-alpha.20", | ||
"@jupyterlab/translation": "^4.0.0-alpha.20", | ||
"@lumino/coreutils": "^2.0.0-rc.0", | ||
"@lumino/messaging": "^2.0.0-rc.0", | ||
"@lumino/signaling": "^2.0.0-rc.0", | ||
"@lumino/widgets": "^2.0.0-rc.0", | ||
"@jupyterlab/apputils": "^4.0.0-alpha.21", | ||
"@jupyterlab/coreutils": "^6.0.0-alpha.21", | ||
"@jupyterlab/nbformat": "^4.0.0-alpha.21", | ||
"@jupyterlab/observables": "^5.0.0-alpha.21", | ||
"@jupyterlab/rendermime-interfaces": "^3.8.0-alpha.21", | ||
"@jupyterlab/services": "^7.0.0-alpha.21", | ||
"@jupyterlab/translation": "^4.0.0-alpha.21", | ||
"@lumino/coreutils": "^2.0.0-rc.1", | ||
"@lumino/messaging": "^2.0.0-rc.1", | ||
"@lumino/signaling": "^2.0.0-rc.1", | ||
"@lumino/widgets": "^2.0.0-rc.1", | ||
"lodash.escape": "^4.0.1" | ||
}, | ||
"devDependencies": { | ||
"@jupyterlab/testing": "^4.0.0-alpha.20", | ||
"@jupyterlab/testing": "^4.0.0-alpha.21", | ||
"@types/jest": "^29.2.0", | ||
@@ -66,3 +66,3 @@ "@types/lodash.escape": "^4.0.6", | ||
"typedoc": "~0.23.25", | ||
"typescript": "~5.0.0-beta" | ||
"typescript": "~5.0.1-rc" | ||
}, | ||
@@ -69,0 +69,0 @@ "publishConfig": { |
@@ -5,6 +5,6 @@ /* ----------------------------------------------------------------------------- | ||
|----------------------------------------------------------------------------*/ | ||
import { ISanitizer, ISessionContext, Sanitizer } from '@jupyterlab/apputils'; | ||
import { Sanitizer } from '@jupyterlab/apputils'; | ||
import { PathExt, URLExt } from '@jupyterlab/coreutils'; | ||
import { IRenderMime } from '@jupyterlab/rendermime-interfaces'; | ||
import { Contents, Session } from '@jupyterlab/services'; | ||
import { Contents } from '@jupyterlab/services'; | ||
import { ITranslator, nullTranslator } from '@jupyterlab/translation'; | ||
@@ -51,3 +51,3 @@ import { ReadonlyPartialJSONObject } from '@lumino/coreutils'; | ||
*/ | ||
readonly sanitizer: ISanitizer; | ||
readonly sanitizer: IRenderMime.ISanitizer; | ||
@@ -335,11 +335,3 @@ /** | ||
constructor(options: IUrlResolverOptions) { | ||
if (options.path) { | ||
this._path = options.path; | ||
} else if (options.session) { | ||
this._session = options.session; | ||
} else { | ||
throw new Error( | ||
"Either 'path' or 'session' must be given as a constructor option" | ||
); | ||
} | ||
this._path = options.path; | ||
this._contents = options.contents; | ||
@@ -352,3 +344,3 @@ } | ||
get path(): string { | ||
return this._path ?? this._session.path; | ||
return this._path; | ||
} | ||
@@ -417,3 +409,2 @@ set path(value: string) { | ||
private _path: string; | ||
private _session: ISessionContext | Session.ISessionConnection; | ||
private _contents: Contents.IManager; | ||
@@ -432,18 +423,5 @@ } | ||
*/ | ||
path?: string; | ||
path: string; | ||
/** | ||
* The session used by the resolver. | ||
* | ||
* @deprecated use the `path` option instead and update it as needed. | ||
* | ||
* #### Notes | ||
* For convenience, this can be a session context as well. Either session | ||
* or path must be given, and path takes precedence. | ||
* | ||
* TODO: remove this option and make `path` required. | ||
*/ | ||
session?: ISessionContext | Session.ISessionConnection; | ||
/** | ||
* The contents manager used by the resolver. | ||
@@ -487,10 +465,2 @@ */ | ||
} | ||
export function sessionConnection( | ||
s: Session.ISessionConnection | ISessionContext | ||
): Session.ISessionConnection | null { | ||
return (s as any).sessionChanged | ||
? (s as ISessionContext).session | ||
: (s as Session.ISessionConnection); | ||
} | ||
} |
@@ -6,3 +6,2 @@ /* ----------------------------------------------------------------------------- | ||
import { ISanitizer } from '@jupyterlab/apputils'; | ||
import { URLExt } from '@jupyterlab/coreutils'; | ||
@@ -127,3 +126,3 @@ import { IRenderMime } from '@jupyterlab/rendermime-interfaces'; | ||
*/ | ||
sanitizer: ISanitizer; | ||
sanitizer: IRenderMime.ISanitizer; | ||
@@ -376,3 +375,3 @@ /** | ||
*/ | ||
sanitizer: ISanitizer; | ||
sanitizer: IRenderMime.ISanitizer; | ||
@@ -687,3 +686,6 @@ /** | ||
// Note: only text nodes and span elements should be present after sanitization in the `<pre>` element. | ||
const linkedNodes = autolink(preTextContent); | ||
const linkedNodes = | ||
sanitizer.getAutolink?.() ?? true | ||
? autolink(preTextContent) | ||
: [document.createTextNode(content)]; | ||
let inAnchorElement = false; | ||
@@ -763,3 +765,3 @@ | ||
*/ | ||
sanitizer: ISanitizer; | ||
sanitizer: IRenderMime.ISanitizer; | ||
@@ -766,0 +768,0 @@ /** |
@@ -6,3 +6,2 @@ /* ----------------------------------------------------------------------------- | ||
import { ISanitizer } from '@jupyterlab/apputils'; | ||
import { IRenderMime } from '@jupyterlab/rendermime-interfaces'; | ||
@@ -24,3 +23,3 @@ import { ITranslator } from '@jupyterlab/translation'; | ||
*/ | ||
readonly sanitizer: ISanitizer; | ||
readonly sanitizer: IRenderMime.ISanitizer; | ||
@@ -27,0 +26,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
280786
7267
1
Updated@lumino/widgets@^2.0.0-rc.1