6.0.524 • Published 5 years ago

@ibm-wch-sdk/ng-edit v6.0.524

Weekly downloads
16
License
MIT
Repository
-
Last release
5 years ago

ibm-wch-sdk-ng-edit

Module to attach inline-edit functionality to an WCH based Angular application. The library exposes the WchNgEditModule module.

Changes

CHANGELOG

Details

Refer to the documentation.

Class documentation

Refer to the documentation.

Usage

Install the module via

npm install --save @ibm-wch-sdk/ng-edit

Add the module to your root application

@NgModule({
  ...
  imports: [
    ...
    WchNgEditModule.forRoot(environment)
  ],
  ...
})
export class AppModule { }

The module exposes the WchEditService and the wchEditable directive.

Prereqs

Directive wchEditable

The directive attaches inline edit functionality to an element that is managed by WCH. The implementation in this library only dispatches the actual realization of the inline-edit functionality to a pluggable service provider.

The directive assumes that the Component contains a onRenderingContext property that exposes the RenderingContext of the item currently edited. This contract is fulfilled automatically if the component extends AbstractRenderingComponent.

The directive requires as a parameter a string identifying the editable property. This string must reference a property on the Component that has been bound to a field of the content item via a @RenderingContextBinding directive. This directive contains the actual selector of the field. Note that this binding is done automatically if the components are generated via the CLI.

Example

<div wchEditable="myField">{{renderingContext.elements.myField.value}}</div>

assuming the following binding

export class MyComponent extends AbstractRenderingComponent {
  @RenderingContextBinding('elements.myField.value') myField: string;
}

WchNgEditModule

The module exposes the directives and services. Per default it provides a service that loads the inline edit functionality from the site composer, when registering the module using the forRoot method.

  • forRoot(config?): the method registers the module and provides a service to load inline edit from the site composer. The location to load the edit script from is configurable via the config script, typically used for local debugging of the script via the inlineEditUrl member on the config object. A convenient way to inject this is to add inlineEditUrl to your environment object and then inject the environment object.

Example

import { WchNgEditModule } from '@ibm-wch-sdk/ng-edit';


@NgModule({
  ...
  imports: [
    ...
    WchNgEditModule.forRoot(environment),
    ...
  ]
})
export class AppModule {
}

WchEditInfoService

The service allows to find out if an inline edit operation is taking place. Applications might want to stop any background processing during this period to avoid intercepting with the edit operation.

  • onEditing: Observable<boolean>: the observable that tracks the state of the current inline edit operation. It is a shared observable that dispatches the current state and all subsequent states.

WchInlineEditService

Service providers implement the WchInlineEditService and provide to the module. This service realizes the actual implementation of the inline edit operation.

  • registerComponent(el, accessor, onRenderingContext): Observable<EventTargetLike>: this method will be invoked by the [wchEditable] directive for every editable element in the application. The el parameter references the editable DOM element. The accessor is string that represents the Javascript property accessor into the content items for the editable element. onRenderingContext exposes the context of the currently edited item. The method returns an observable of an event emitter. Subscribing to this observable makes the registration active, unsubscribing cancels it. The event emitter is used to listen for edit events.

Edit events

The following inline edit events are recognized:

  • wchEditStart: fired when an element enters into inline edit mode. This is used to track this status by the WchEditInfoService.
  • wchEditEnd: fired when an element leaves inline edit mode (no matter whether the edit operation has been canceled or completed). This is used to track this status by the WchEditInfoService.

WchHttpInlineEditService

The default implementation of the WchInlineEditService. If the system is in preview mode, then the service lazily loads an inline edit script from a configurable location. Per default this location points to TODO, it can be overridden by the inlineEditUrl property on the config object for the module.

Script requirements

The inline edit script will be loaded via an HTTP request and executed dynamically. It needs to contain an IIFE that returns a registration object with the following properties:

  • register(el, accessor, onRenderingContext): Handle: the register method will be called for every editable element, so the implementation of the method can attach the necessary event handlers to the DOM element to make it editable. The method returns a handle that allows to cancel the registration and to attach event handlers to the inline edit process to monitor it. The method receives the DOM element via the el parameter and an accessor that represents a Javascript property expression for the editable element in the content item. The onRenderingContext observable exposes the current context of the rendered item.

Handle

The handle needs to conform to one of the signatures of EventTargetLike from the RXJS spec. In addition it can expose a dispose method.

  • dispose: the dispose method on the handle will be invoked to cancel a registration. This happens when the editable element falls out of scope, e.g. because of a page switch or because the application decides to hide it or for any other reason. Implementers need to make sure to unregister all previously registered event handlers.

Require

The inline edit script can use a require function that is available in its scope to load extra resources or services exposed by the SDK. The following services are available:

  • wch-config: a configuration object containing URLs for the current tenant
  • wch-info: the hub configuration exposed to the SDK by the SPA
  • wch-logger: access to the SDK logging infrastructure. It is suggested to uses the exposed logger instead of console logs.

In addition the require function will resolve URLs relative to the URL used to load the script and returns the result as text. All return values are exposed as promises.

Example for accessing the config:

const config = require('wch-config');
config.then(c => console.log(c.apiUrl));

Example for loading an extra resource:

const res = require('./myExtraResource.txt');
res.then(console.log);

Example for using the logger:

const logger = require('wch-logger');
logger
  .then(logger => logger.get('MyModule'))
  .then(log => log.info('some log output'));

Accessor Expression

Accessor expressions allow to identify the field of a Content Item that the inline edit operation refers to. It is a string in the format of a Javascript property accessor.

Examples

  • name: accesses the name attribute of a content item.
  • elements.myText.value: accesses the value of a single valued element called myText.
  • elements.myTexts.values[2]: accesses the third value of a multi valued element called myTexts.

Changelog

Current

6.0.69

Changed

  • Improved readme

Added

  • Support for Angular 6
  • Support for group elements
  • Initial version

WchNgEditModule

Module that allows to attach inline edit functionality to a WCH based Angular application.

Usage

Install the module

npm install --save ibm-wch-sdk-ng-edit

Import the module into your application. Use the environment variable to configure the module, this is the same configuration as for the main WchNgModule module.

import {WchNgEditModule} from 'ibm-wch-sdk-ng-edit';

...

@NgModule({
  ...
  imports: [
    WchNgEditModule.forRoot(environment)
    ...
  ]

Annotate your editable components. Pass the selector to the text field as parameter to the directive.

<div wchEditable='elements.myText'>{{renderingContext.elements.myText.value}}</div>

Dependencies

The modules assumes an implementation of the WchInlineEditService. This service must be injected into the main module.

Developing modules based on the SDK

When developing modules that use the SDK, make sure to import the WchNgEditComponentsModule to have access to the components and directives exposed by the SDK.

Configuration

The module can be configured via the forRoot method or by providing overrides for the individual configuration tokens.

Components

The module exposes the following Components.

@ibm-wch-sdk/ng-edit

Index

External modules


@ibm-wch-sdk/ng-edit > "components/login/abstract.login.component"

External module: "components/login/abstract.login.component"

Index

Classes

Variables


Variables

<Const> LOGGER

● LOGGER: "AbstractLoginComponent" = "AbstractLoginComponent"

Defined in components/login/abstract.login.component.ts:17


@ibm-wch-sdk/ng-edit > "components/placeholder/placeholder.component"

External module: "components/placeholder/placeholder.component"

Index

Classes

Variables


Variables

<Let> COUNT

● COUNT: number = 0

Defined in components/placeholder/placeholder.component.ts:49


<Const> LOGGER

● LOGGER: "WchPlaceholderComponent" = "WchPlaceholderComponent"

Defined in components/placeholder/placeholder.component.ts:46


@ibm-wch-sdk/ng-edit > "config/config"

External module: "config/config"

Index

Variables


Variables

<Const> WCH_EDIT_HUB_INFO_SERVICE

● WCH_EDIT_HUB_INFO_SERVICE: InjectionToken<EditHubInfoService> = new InjectionToken( 'EditHubInfoService' )

Defined in config/config.ts:46


<Const> WCH_THROTTLE_LOADING

● WCH_THROTTLE_LOADING: "D1576F60-7D2A-4824-9771-A1EB574771DB" = "D1576F60-7D2A-4824-9771-A1EB574771DB"

Defined in config/config.ts:44

Injection token for placeholder debugging

see: EditHubInfoService


<Const> WCH_TOKEN_DEBUG_PLACEHOLDERS

● WCH_TOKEN_DEBUG_PLACEHOLDERS: "03066F08-3E5E-41BE-B1E9-B0F31D0C881D" = "03066F08-3E5E-41BE-B1E9-B0F31D0C881D"

Defined in config/config.ts:36

Injection token for placeholder debugging

see: EditHubInfoService


<Const> WCH_TOKEN_DEFAULT_PLACEHOLDER_TEXT

● WCH_TOKEN_DEFAULT_PLACEHOLDER_TEXT: "10DDECF4-3818-4B08-BD34-CA073F831E9B" = "10DDECF4-3818-4B08-BD34-CA073F831E9B"

Defined in config/config.ts:14

Injection token for default placeholder text

see: EditHubInfoService import { InjectionToken } from '@angular/core';

import { EditHubInfoService } from './../services/config/wch.edit.config';


<Const> WCH_TOKEN_INLINE_EDIT_URL

● WCH_TOKEN_INLINE_EDIT_URL: "0E7D0A87-FBDD-4565-9C8F-DB5909B6D9AF" = "0E7D0A87-FBDD-4565-9C8F-DB5909B6D9AF"

Defined in config/config.ts:22

Injection token for inline edit url

see: EditHubInfoService


<Const> WCH_TOKEN_PLACEHOLDER_TAG

● WCH_TOKEN_PLACEHOLDER_TAG: "C80F7BDA-438D-49F9-B63B-3BDA1FC13E99" = "C80F7BDA-438D-49F9-B63B-3BDA1FC13E99"

Defined in config/config.ts:29

Injection token for placeholder tag

see: EditHubInfoService


@ibm-wch-sdk/ng-edit > "config/index"

External module: "config/index"

Index


@ibm-wch-sdk/ng-edit > "directives/editable/abstract.editable.directive"

External module: "directives/editable/abstract.editable.directive"

Index

Classes

Type aliases

Variables


Type aliases

WchEditableType

Ƭ WchEditableType: string | null

Defined in directives/editable/abstract.editable.directive.ts:80


Variables

<Const> COMPONENT_ACCESSOR

● COMPONENT_ACCESSOR: AccessorType = null

Defined in directives/editable/abstract.editable.directive.ts:83


<Let> COUNT

● COUNT: number = 0

Defined in directives/editable/abstract.editable.directive.ts:73


<Const> KEY_ON_RENDERING_CONTEXT

● KEY_ON_RENDERING_CONTEXT: "onRenderingContext" = "onRenderingContext"

Defined in directives/editable/abstract.editable.directive.ts:75


<Const> LOGGER

● LOGGER: "AbstractWchEditableDirective" = "AbstractWchEditableDirective"

Defined in directives/editable/abstract.editable.directive.ts:77


<Const> ON_COMPONENT_ACCESSOR

● ON_COMPONENT_ACCESSOR: Observable<string> = of(COMPONENT_ACCESSOR)

Defined in directives/editable/abstract.editable.directive.ts:86


@ibm-wch-sdk/ng-edit > "directives/editable/editable.directive"

External module: "directives/editable/editable.directive"

Index

Classes


@ibm-wch-sdk/ng-edit > "directives/editable/editable.placeholder.directive"

External module: "directives/editable/editable.placeholder.directive"

Index

Classes

Type aliases

Variables

Functions


Type aliases

TEXT_PROPERTY

Ƭ TEXT_PROPERTY: "innerHTML" | "innerText"

Defined in directives/editable/editable.placeholder.directive.ts:72


Variables

<Const> LOGGER

● LOGGER: "WchEditablePlaceholderDirective" = "WchEditablePlaceholderDirective"

Defined in directives/editable/editable.placeholder.directive.ts:70


Functions

_setText

_setText(aProp: TEXT_PROPERTY, aLocalizedText: LocalizedText, aElement: ElementRef, aRenderer: Renderer2): void

Defined in directives/editable/editable.placeholder.directive.ts:82

Assigns the text to a value

Parameters:

NameTypeDescription
aPropTEXT_PROPERTYthe property to assign
aLocalizedTextLocalizedTextthe actual text
aElementElementRefthe native element
aRendererRenderer2render used to assign the text

Returns: void


<Const> _textSetter

_textSetter(aElement: any, aRenderer: Renderer2): (Anonymous function)

Defined in directives/editable/editable.placeholder.directive.ts:113

Binds the element ref and the renderer

Parameters:

NameTypeDescription
aElementanythe eleemnt reference
aRendererRenderer2the renderer

Returns: (Anonymous function) function that only takes the property name and the


@ibm-wch-sdk/ng-edit > "index"

External module: "index"

Index


@ibm-wch-sdk/ng-edit > "interfaces/inline.edit.service"

External module: "interfaces/inline.edit.service"

Index

Variables


Variables

<Const> EVENT_EDIT_END

● EVENT_EDIT_END: "wchEditEnd" = "wchEditEnd"

Defined in interfaces/inline.edit.service.ts:7


<Const> EVENT_EDIT_START

● EVENT_EDIT_START: "wchEditStart" = "wchEditStart"

Defined in interfaces/inline.edit.service.ts:6


<Const> EVENT_INLINE_EDIT_END

● EVENT_INLINE_EDIT_END: "wchInlineEditEnd" = "wchInlineEditEnd"

Defined in interfaces/inline.edit.service.ts:10


<Const> EVENT_INLINE_EDIT_START

● EVENT_INLINE_EDIT_START: "wchInlineEditStart" = "wchInlineEditStart"

Defined in interfaces/inline.edit.service.ts:9


<Const> WchInlineEditServiceToken

● WchInlineEditServiceToken: InjectionToken<WchInlineEditService> = new InjectionToken< WchInlineEditService

('WchInlineEditServiceToken')

Defined in interfaces/inline.edit.service.ts:15


@ibm-wch-sdk/ng-edit > "module"

External module: "module"

Index

Classes

Variables


Variables

<Const> WCH_RC_INTERCEPTOR_TOKEN

● WCH_RC_INTERCEPTOR_TOKEN: "8453750A-4519-4184-840B-D490E909D23E" = "8453750A-4519-4184-840B-D490E909D23E"

Defined in module.ts:32


@ibm-wch-sdk/ng-edit > "modules/components.module"

External module: "modules/components.module"

Index

Classes


@ibm-wch-sdk/ng-edit > "modules/services.module"

External module: "modules/services.module"

Index

Classes


@ibm-wch-sdk/ng-edit > "placeholder/placeholder"

External module: "placeholder/placeholder"

Index

Variables

Functions


Variables

<Const> REL_PATH_TYPE_BY_ID

● REL_PATH_TYPE_BY_ID: "delivery/v1/rendering/type/" = "delivery/v1/rendering/type/"

Defined in placeholder/placeholder.ts:8


Functions

loadAuthoringType

loadAuthoringType(aService: WchHttpService, aTypeId: string): Observable<AuthoringType>

Defined in placeholder/placeholder.ts:10

Parameters:

NameType
aServiceWchHttpService
aTypeIdstring

Returns: Observable<AuthoringType>


@ibm-wch-sdk/ng-edit > "services/config/default.wch.edit.config"

External module: "services/config/default.wch.edit.config"

Index

Variables


Variables

<Const> DEFAULT_DEBUG_PLACEHOLDERS

● DEFAULT_DEBUG_PLACEHOLDERS: false = false

Defined in services/config/default.wch.edit.config.ts:8


<Const> DEFAULT_INLINE_EDIT_URL

● DEFAULT_INLINE_EDIT_URL: "${authoringUIBaseUrl.protocol}//${authoringUIBaseUrl.host}/authoring-sites-ui/inline-edit/inline-edit.js" = "${authoringUIBaseUrl.protocol}//${authoringUIBaseUrl.host}/authoring-sites-ui/inline-edit/inline-edit.js"

Defined in services/config/default.wch.edit.config.ts:4


@ibm-wch-sdk/ng-edit > "services/config/index"

External module: "services/config/index"

Index


@ibm-wch-sdk/ng-edit > "services/config/wch.edit.config"

External module: "services/config/wch.edit.config"

Index

Interfaces

Functions


Functions

selectDebugPlaceholder

selectDebugPlaceholder(aConfig?: EditHubInfoService): boolean

Defined in services/config/wch.edit.config.ts:47

Parameters:

NameType
Optional aConfigEditHubInfoService

Returns: boolean


selectDefaultPlaceholder

selectDefaultPlaceholder(aConfig?: EditHubInfoService): WchDefaultPlaceholder

Defined in services/config/wch.edit.config.ts:41

Parameters:

NameType
Optional aConfigEditHubInfoService

Returns: WchDefaultPlaceholder


selectInlineEditURL

selectInlineEditURL(aConfig?: EditHubInfoService): HubInfoUrlProvider

Defined in services/config/wch.edit.config.ts:51

Parameters:

NameType
Optional aConfigEditHubInfoService

Returns: HubInfoUrlProvider


selectPlaceholderTag

selectPlaceholderTag(aConfig?: EditHubInfoService): string

Defined in services/config/wch.edit.config.ts:57

Parameters:

NameType
Optional aConfigEditHubInfoService

Returns: string


selectThrottleLoading

selectThrottleLoading(aConfig?: EditHubInfoService): number

Defined in services/config/wch.edit.config.ts:61

Parameters:

NameType
Optional aConfigEditHubInfoService

Returns: number


@ibm-wch-sdk/ng-edit > "services/edit/wch.inline.edit.service"

External module: "services/edit/wch.inline.edit.service"

Index

Classes

Variables


Variables

<Const> LOGGER

● LOGGER: "WchInlineEditRegistrationService" = "WchInlineEditRegistrationService"

Defined in services/edit/wch.inline.edit.service.ts:25


@ibm-wch-sdk/ng-edit > "services/http/http.inline.edit.service"

External module: "services/http/http.inline.edit.service"

Index

Classes

Interfaces

Variables

Functions

Object literals


Variables

<Const> EMPTY_REGISTRATION

● EMPTY_REGISTRATION: NodeStyleEventEmitter | JQueryStyleEventEmitter | HasEventTargetAddRemove<any> | NodeStyleEventEmitter & Disposable | JQueryStyleEventEmitter & Disposable | HasEventTargetAddRemove<any> & Disposable = _createEmptyRegistration()

Defined in services/http/http.inline.edit.service.ts:138


<Const> LOGGER

● LOGGER: "WchHttpInlineEditService" = "WchHttpInlineEditService"

Defined in services/http/http.inline.edit.service.ts:73


<Let> REG_ID

● REG_ID: number = 0

Defined in services/http/http.inline.edit.service.ts:141


<Const> _dummyFromEvent

● _dummyFromEvent: function = constGenerator(EMPTY)

Defined in services/http/http.inline.edit.service.ts:228

Dummy callback

param:

Type declaration

▸<T>(): Observable<T>

Type parameters:

T

Returns: Observable<T>


<Const> _fromHubInfoUrlProvider

● _fromHubInfoUrlProvider: UnaryFunction<string | URL, string> = compose< URL | string, GeneratorOrT, string

( urlToString, fromGeneratorOrT )

Defined in services/http/http.inline.edit.service.ts:251

Converts the provider into a URL

param: the provider

returns: the URL if available


<Const> _registerDummyComponent

● _registerDummyComponent: function = constGenerator(of(EMPTY_REGISTRATION))

Defined in services/http/http.inline.edit.service.ts:237

Registers a dummy component

param: the native element

param: the accesor

param: rendering context

Type declaration

▸(): T

Returns: T


Functions

_createEmptyRegistration

_createEmptyRegistration(): WchInlineEditRegistrationResult

Defined in services/http/http.inline.edit.service.ts:85

Creates an empty registration result as fallback

Returns: WchInlineEditRegistrationResult


_createRegistration

_createRegistration(aRegisterMethod: WchInlineEditRegistration, nativeElement: any, accessor: AccessorType, onRenderingContext: Observable<RenderingContext>, logger: Logger): Observable<EventTargetLike<any>>

Defined in services/http/http.inline.edit.service.ts:153

Constructs the registration for a native element

Parameters:

NameTypeDescription
aRegisterMethodWchInlineEditRegistrationregistration callback method
nativeElementanythe native element
accessorAccessorTypeaccessor string
onRenderingContextObservable<RenderingContext>rendering context
loggerLogger

Returns: Observable<EventTargetLike<any>> observable of the registration result in form of an event emitter


_createWchInlineEditEvent

_createWchInlineEditEvent(aType: string, aData: any): WchInlineEditEvent

Defined in services/http/http.inline.edit.service.ts:102

Constructs the event

Parameters:

NameTypeDescription
aTypestringthe event type
aDataanythe event data

Returns: WchInlineEditEvent the event object


_getAbsoluteUrl

_getAbsoluteUrl(base: string, relative: string): string

Defined in services/http/http.inline.edit.service.ts:199

Resolves a relative URL against a base URL

Parameters:

NameTypeDescription
basestringthe base URL
relativestringthe relative URL

Returns: string the result


_registerForEvent

_registerForEvent(aType: string, aEmitter: EventTargetLike<any>, aLogger: Logger): Observable<WchInlineEditEvent>

Defined in services/http/http.inline.edit.service.ts:121

Registers for an event

Parameters:

NameTypeDescription
aTypestringthe event type
aEmitterEventTargetLike<any>the event emitter
aLoggerLogger

Returns: Observable<WchInlineEditEvent> the sequence of events


Object literals

<Const> EMPTY_WCH_INLINE_EDIT_SERVICE

EMPTY_WCH_INLINE_EDIT_SERVICE: object

Defined in services/http/http.inline.edit.service.ts:240

fromEvent

● fromEvent: function = _dummyFromEvent

Defined in services/http/http.inline.edit.service.ts:242

Type declaration

▸<T>(): Observable<T>

Type parameters:

T

Returns: Observable<T>


registerComponent

● registerComponent: function = _registerDummyComponent

Defined in services/http/http.inline.edit.service.ts:241

Type declaration

▸(): T

Returns: T



@ibm-wch-sdk/ng-edit > "services/http/index"

External module: "services/http/index"

Index


@ibm-wch-sdk/ng-edit > "services/index"

External module: "services/index"

Index


@ibm-wch-sdk/ng-edit > "services/info/index"

External module: "services/info/index"

Index


@ibm-wch-sdk/ng-edit > "services/info/wch.edit.info.service"

External module: "services/info/wch.edit.info.service"

Index

Classes

Variables


Variables

<Const> LOGGER

● LOGGER: "WchEditInfoService" = "WchEditInfoService"

Defined in services/info/wch.edit.info.service.ts:10


@ibm-wch-sdk/ng-edit > "services/info/wch.internal.edit.service"

External module: "services/info/wch.internal.edit.service"

Index

Classes

Variables


Variables

<Const> DEFAULT_EDITING

● DEFAULT_EDITING: false = false

Defined in services/info/wch.internal.edit.service.ts:9


<Const> DEFAULT_INLINE_EDIT

● DEFAULT_INLINE_EDIT: false = false

Defined in services/info/wch.internal.edit.service.ts:10


@ibm-wch-sdk/ng-edit > "services/placeholders/placeholders.service"

External module: "services/placeholders/placeholders.service"

Index

Classes

Interfaces

Variables


Variables

<Const> LOGGER

● LOGGER: "WchPlaceholderImpl" = "WchPlaceholderImpl"

Defined in services/placeholders/placeholders.service.ts:94


<Const> _selectFromWchPlaceholder

● _selectFromWchPlaceholder: function = pluckProperty

Defined in services/placeholders/placeholders.service.ts:339

some type magic

Type declaration

▸<K>(aKey: K): UnaryFunction<WchPlaceholder, WchPlaceholder[K]>

Type parameters:

K : keyof WchPlaceholder

Parameters:

NameType
aKeyK

Returns: UnaryFunction<WchPlaceholder, WchPlaceholder[K]>


<Const> opOnAccessor

● opOnAccessor: OperatorFunction<WchPlaceholder, string> = switchMap( selectOnAccessor )

Defined in services/placeholders/placeholders.service.ts:357


<Const> opOnData

● opOnData: OperatorFunction<WchPlaceholder, any> = switchMap( selectOnData )

Defined in services/placeholders/placeholders.service.ts:364


<Const> opOnFormattedText

● opOnFormattedText: OperatorFunction<WchPlaceholder, LocalizedText> = switchMap(selectOnFormattedText)

Defined in services/placeholders/placeholders.service.ts:371


<Const> opOnPlaceholder

● opOnPlaceholder: OperatorFunction<WchPlaceholder, AuthoringPlaceholder> = switchMap(selectOnPlaceholder)

Defined in services/placeholders/placeholders.service.ts:360


<Const> opOnPlainText

● opOnPlainText: OperatorFunction<WchPlaceholder, LocalizedText> = switchMap(selectOnPlainText)

Defined in services/placeholders/placeholders.service.ts:367


<Const> opOnType

● opOnType: OperatorFunction<WchPlaceholder, string> = switchMap( selectOnType )

Defined in services/placeholders/placeholders.service.ts:375


<Const> selectOnAccessor

● selectOnAccessor: UnaryFunction<WchPlaceholder, Observable<string>> = _selectFromWchPlaceholder('onAccessor')

Defined in services/placeholders/placeholders.service.ts:347


<Const> selectOnData

● selectOnData: UnaryFunction<WchPlaceholder, Observable<any>> = _selectFromWchPlaceholder('onData')

Defined in services/placeholders/placeholders.service.ts:349


<Const> selectOnFormattedText

● selectOnFormattedText: UnaryFunction<WchPlaceholder, Observable<Object>> = _selectFromWchPlaceholder( 'onFormattedText' )

Defined in services/placeholders/placeholders.service.ts:351


<Const> selectOnPlaceholder

● selectOnPlaceholder: UnaryFunction<WchPlaceholder, Observable<AuthoringPlaceholder>> = _selectFromWchPlaceholder('onPlaceholder')

Defined in services/placeholders/placeholders.service.ts:348


<Const> selectOnPlainText

● selectOnPlainText: UnaryFunction<WchPlaceholder, Observable<Object>> = _selectFromWchPlaceholder('onPlainText')

Defined in services/placeholders/placeholders.service.ts:350


<Const> selectOnType

● selectOnType: UnaryFunction<WchPlaceholder, Observable<string>> = _selectFromWchPlaceholder('onType')

Defined in services/placeholders/placeholders.service.ts:354


@ibm-wch-sdk/ng-edit > "services/rendering/index"

External module: "services/rendering/index"

Index


@ibm-wch-sdk/ng-edit > "services/rendering/placeholder.interceptor"

External module: "services/rendering/placeholder.interceptor"

Index

Classes

Variables


Variables

<Const> LOGGER

● LOGGER: "PlaceholderInterceptor" = "PlaceholderInterceptor"

Defined in services/rendering/placeholder.interceptor.ts:38


@ibm-wch-sdk/ng-edit > "services/wch/index"

External module: "services/wch/index"

Index


@ibm-wch-sdk/ng-edit > "services/wch/wch.edit.service"

External module: "services/wch/wch.edit.service"

Index

Classes

Variables

Functions

Object literals


Variables

<Const> FALSE_OBSERVABLE

● FALSE_OBSERVABLE: Observable<boolean> = opFalse

Defined in services/wch/wch.edit.service.ts:74


<Const> LOGGER

● LOGGER: "WchEditService" = "WchEditService"

Defined in services/wch/wch.edit.service.ts:72


Functions

<Const> TO_ANONYMOUS

TO_ANONYMOUS(): Observable<User>

Defined in services/wch/wch.edit.service.ts:76

Returns: Observable<User>


<Const> TO_FALSE

TO_FALSE(): Observable<boolean>

Defined in services/wch/wch.edit.service.ts:75

Returns: Observable<boolean>


<Const> getCurrentTenantUrl

getCurrentTenantUrl(aBase: string): string

Defined in services/wch/wch.edit.service.ts:90

Parameters:

NameType
aBasestring

Returns: string


<Const> getCurrentUserUrl

getCurrentUserUrl(aBase: string): string

Defined in services/wch/wch.edit.service.ts:89

Parameters:

NameType
aBasestring

Returns: string


<Const> isAuthenticated

isAuthenticated(aUser: User): boolean

Defined in services/wch/wch.edit.service.ts:94

Parameters:

NameType
aUserUser

Returns: boolean


Object literals

<Const> ANONYMOUS_USER

ANONYMOUS_USER: object

Defined in services/wch/wch.edit.service.ts:66

externalId

● externalId: string = "ibm_anonymous_user@de.ibm.com"

Defined in services/wch/wch.edit.service.ts:69


id

● id: string = "00000000-0000-f000-0000-000000000000"

Defined in services/wch/wch.edit.service.ts:67


roles

● roles: undefined[] = []

Defined in services/wch/wch.edit.service.ts:68



<Const> HTTP_WITH_CREDENTIALS

HTTP_WITH_CREDENTIALS: object

Defined in services/wch/wch.edit.service.ts:78

withCredentials

● withCredentials: true = true

Defined in services/wch/wch.edit.service.ts:78



<Const> JSON_WITHOUT_CREDENTIALS

JSON_WITHOUT_CREDENTIALS: object

Defined in services/wch/wch.edit.service.ts:83

responseType

● responseType: "json" = "json"

Defined in services/wch/wch.edit.service.ts:86


withCredentials

● withCredentials: false = false

Defined in services/wch/wch.edit.service.ts:86



<Const> JSON_WITH_CREDENTIALS

JSON_WITH_CREDENTIALS: object

Defined in services/wch/wch.edit.service.ts:79

responseType

● responseType: "json" = "json"

Defined in services/wch/wch.edit.service.ts:82


withCredentials

● withCredentials: true = true

Defined in services/wch/wch.edit.service.ts:82



@ibm-wch-sdk/ng-edit > "utils/assert"

External module: "utils/assert"

Index

Functions


Functions

_assert

_assert<T>(aPredicate: function, aFailHandler: function): function

Defined in utils/assert.ts:3

Type parameters:

T

Parameters:

NameType
aPredicatefunction
aFailHandlerfunction

Returns: function


@ibm-wch-sdk/ng-edit > "utils/config"

External module: "utils/config"

Index

Functions


Functions

loadWchConfig

loadWchConfig(aJsonp: WchHttpService): Observable<WchConfig>

Defined in utils/config.ts:16

Loads the WCH config

Parameters:

NameTypeDescription
aJsonpWchHttpServicethe JSONp callback

Returns: Observable<WchConfig> the resulting config object


@ibm-wch-sdk/ng-edit > "utils/events"

External module: "utils/events"

Index

Functions


Functions

_createWchEditableEvent

_createWchEditableEvent(aType: string, aTarget: HTMLElement, aData: any): WchEditableEvent

Defined in utils/events.ts:18

Constructs the event

Parameters:

NameTypeDescription
aTypestringthe event type
aTargetHTMLElementthe target node
aDataanythe event data

Returns: WchEditableEvent the event object


_registerForEvent

_registerForEvent(aType: string, aTarget: HTMLElement, aEmitter: EventTargetLike<any>, aLogger: Logger): Observable<WchEditableEvent>

Defined in utils/events.ts:41

Registers for an event

Parameters:

NameTypeDescription
aTypestringthe event type
aTargetHTMLElementthe current element
aEmitterEventTargetLike<any>the event emitter
aLoggerLogger

Returns: Observable<WchEditableEvent> the sequence of events


createWchEditableEvents

createWchEditableEvents(aTarget: HTMLElement, aEmitter: EventTargetLike<any>, aLogger: Logger): Observable<WchEditableEvent>

Defined in utils/events.ts:67

Construct the event stream

Parameters:

NameTypeDescription
aTargetHTMLElementthe target element
aEmitterEventTargetLike<any>the event emitter
aLoggerLogger

Returns: Observable<WchEditableEvent> the event stream


@ibm-wch-sdk/ng-edit > "utils/placeholder"

External module: "utils/placeholder"

Index

Type aliases

Variables

Functions


Type aliases

WchDefaultPlaceholder

Ƭ WchDefaultPlaceholder: ObservableOrT<string | LocalizedText>

Defined in utils/placeholder.ts:43

type for placeholder


WchEditableFormat

Ƭ WchEditableFormat: "text" | "html" | "auto"

Defined in utils/placeholder.ts:50

Potential values for the 'wchFormat' field


Variables

<Const> UNDEFINED

● UNDEFINED: any = undefined

Defined in utils/placeholder.ts:56


<Const> WCH_EDITABLE_AUTO_FORMAT

● WCH_EDITABLE_AUTO_FORMAT: "auto" = "auto"

Defined in utils/placeholder.ts:53


<Const> WCH_EDITABLE_HTML_FORMAT

● WCH_EDITABLE_HTML_FORMAT: "html" = "html"

Defined in utils/placeholder.ts:54


<Const> WCH_EDITABLE_TEXT_FORMAT

● WCH_EDITABLE_TEXT_FORMAT: "text" = "text"

Defined in utils/placeholder.ts:52


<

6.0.524

5 years ago

7.2.608

5 years ago

7.2.591

5 years ago

7.2.435

5 years ago

7.2.407

5 years ago

7.2.358

5 years ago

7.2.291

5 years ago

7.2.290

5 years ago

6.0.498

5 years ago

6.0.496

5 years ago

6.0.477

5 years ago

7.0.165

5 years ago

7.0.163

5 years ago

7.0.151

5 years ago

6.0.455

6 years ago

7.0.25

6 years ago

7.0.22

6 years ago

7.0.16

6 years ago

7.0.14

6 years ago

6.0.401

6 years ago

6.0.383

6 years ago

6.0.341

6 years ago

6.0.264

6 years ago

6.0.293

6 years ago

6.0.287

6 years ago

6.0.238

6 years ago

6.0.232

6 years ago

6.0.185

6 years ago

6.0.178

6 years ago

6.0.162

6 years ago

6.0.159

6 years ago

6.0.157

6 years ago

6.0.155

6 years ago

6.0.154

6 years ago

6.0.152

6 years ago

6.0.149

6 years ago

6.0.132

6 years ago

6.0.126

6 years ago

6.0.120

6 years ago

6.0.119

6 years ago

6.0.118

6 years ago

6.0.112

6 years ago

6.0.108

6 years ago

6.0.107

6 years ago

6.0.75

6 years ago

6.0.66

6 years ago

6.0.54

6 years ago

6.0.42

6 years ago

6.0.39

6 years ago

6.0.17

6 years ago